upload webkit/tizen 2.0_beta source.
[framework/web/webkit-efl.git] / LayoutTests / pointer-lock / lock-fail-responses.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8     description("Test asynchronous results of calling lock.")
9     window.jsTestIsAsync = true;
10     shouldBeDefined("window.layoutTestController");
11
12     currentStep = 0;
13     function doNextStep() {
14       todo[currentStep++]();
15     }
16     todo = [
17         function () {
18             layoutTestController.setPointerLockWillFailSynchronously();
19             navigator.webkitPointer.lock(document.body,
20                 function () {
21                     testFailed("Lock succeeded unexpectedly.");
22                     finishJSTest();
23                 },
24                 function () {
25                     testPassed("Lock failed (after we called layoutTestController.setPointerLockWillFailSynchronously)");
26                     doNextStep();
27                 });
28         },
29         function () {
30             layoutTestController.setPointerLockWillFailAsynchronously();
31             navigator.webkitPointer.lock(document.body,
32                 function () {
33                     testFailed("Lock succeeded unexpectedly.");
34                     finishJSTest();
35                 },
36                 function () {
37                     testPassed("Lock failed (after we called layoutTestController.setPointerLockWillFailAsynchronously)");
38                     doNextStep();
39                 });
40         },
41         finishJSTest
42     ];
43     doNextStep();
44 </script>
45 <script src="../fast/js/resources/js-test-post.js"></script>
46 </body>
47 </html>