2009/dap/contacts/tests/test-cases single_task_queue.html,NONE,1.1

Update of /sources/public/2009/dap/contacts/tests/test-cases
In directory hutz:/tmp/cvs-serv963

Added Files:
	single_task_queue.html 
Log Message:
test for pending op error


--- NEW FILE: single_task_queue.html ---
<!doctype html>
<html>
 <head>
  <title>Contacts API - Single Task Queue</title>
  <script src="../impl.js"></script>
  <script src="http://w3c-test.org/html/tests/resources/testharness.js"></script>
  <script src="http://w3c-test.org/html/tests/resources/testharnessreport.js"></script>
  <script src="common.js"></script>
 </head>
 <body>
   <div id="log"></div>
   <script>
     var t = async_test("Starting two find in a row triggers a pending operation error", {timeout: 15000});
     navigator.contacts.find(["name.formatted"], success);
     navigator.contacts.find(["name.formatted"], success2, error);

     function success(contact) {
        setTimeout( function () {
        }, 5000);
     }

     function success2(contact) {
        t.step(function () {
          assert_unreached();
        });
     }

     function error(err) {
        t.step(function () {
          assert_equals(err.code, navigator.contacts.ContactError.PENDING_OPERATION_ERROR);
        });
        t.done();
     }
  </script>
 </body>
</html>

Received on Monday, 23 May 2011 21:18:22 UTC