Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: LayoutTests/pointer-lock/pointerlockelement-null-when-pending.html

Issue 279313003: Create Document exitPointerLock and pointerLockElement API methods. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../resources/js-test.js"></script> 4 <script src="../resources/js-test.js"></script>
5 <script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"> </script> 5 <script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"> </script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <div> 8 <div>
9 <div id="target1"></div> 9 <div id="target1"></div>
10 </div> 10 </div>
11 <script> 11 <script>
12 description("Test pointerLockElement is null when a lock is pending.") 12 description("Test pointerLockElement is null when a lock is pending.")
13 window.jsTestIsAsync = true; 13 window.jsTestIsAsync = true;
14 14
15 targetDiv1 = document.getElementById("target1"); 15 targetDiv1 = document.getElementById("target1");
16 16
17 todo = [ 17 todo = [
18 function () { 18 function () {
19 shouldBe("document.webkitPointerLockElement", "null"); 19 shouldBe("document.pointerLockElement", "null");
20 testRunner.setPointerLockWillRespondAsynchronously(); 20 testRunner.setPointerLockWillRespondAsynchronously();
21 expectOnlyChangeEvent("Lock."); 21 expectOnlyChangeEvent("Lock.");
22 targetDiv1.requestPointerLock(); 22 targetDiv1.requestPointerLock();
23 doNextStep(); 23 doNextStep();
24 }, 24 },
25 function () { 25 function () {
26 shouldBe("document.webkitPointerLockElement", "null"); 26 shouldBe("document.pointerLockElement", "null");
27 testRunner.didAcquirePointerLock(); 27 testRunner.didAcquirePointerLock();
28 // doNextStep called from event handler set with expect... 28 // doNextStep called from event handler set with expect...
29 }, 29 },
30 function () { 30 function () {
31 shouldBe("document.webkitPointerLockElement", "targetDiv1"); 31 shouldBe("document.pointerLockElement", "targetDiv1");
32 expectOnlyChangeEvent("Unlock."); 32 expectOnlyChangeEvent("Unlock.");
33 document.webkitExitPointerLock(); 33 document.exitPointerLock();
34 shouldBe("document.webkitPointerLockElement", "targetDiv1"); 34 shouldBe("document.pointerLockElement", "targetDiv1");
35 // doNextStep called from event handler set with expect... 35 // doNextStep called from event handler set with expect...
36 }, 36 },
37 function () { 37 function () {
38 shouldBe("document.webkitPointerLockElement", "null"); 38 shouldBe("document.pointerLockElement", "null");
39 doNextStep(); 39 doNextStep();
40 }, 40 },
41 ]; 41 ];
42 doNextStep(); 42 doNextStep();
43 </script> 43 </script>
44 </body> 44 </body>
45 </html> 45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698