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

Side by Side Diff: LayoutTests/pointer-lock/locked-element-removed-from-dom.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 <iframe id="iframe1"></iframe> 9 <iframe id="iframe1"></iframe>
10 <div id="target2"></div> 10 <div id="target2"></div>
(...skipping 14 matching lines...) Expand all
25 function () { 25 function () {
26 // Nest target element into iframe document. 26 // Nest target element into iframe document.
27 targetIframe1.contentDocument.body.innerHTML ="<div><div></div></div >"; 27 targetIframe1.contentDocument.body.innerHTML ="<div><div></div></div >";
28 targetDiv1 = targetIframe1.contentDocument.body.firstChild.firstChil d 28 targetDiv1 = targetIframe1.contentDocument.body.firstChild.firstChil d
29 expectNoEvents("Lock target in iframe. (main document handler)."); 29 expectNoEvents("Lock target in iframe. (main document handler).");
30 expectOnlyChangeEvent("Lock target in iframe. (iframe handler)", tar getIframe1.contentDocument); 30 expectOnlyChangeEvent("Lock target in iframe. (iframe handler)", tar getIframe1.contentDocument);
31 targetDiv1.requestPointerLock(); 31 targetDiv1.requestPointerLock();
32 // doNextStep called by event handler. 32 // doNextStep called by event handler.
33 }, 33 },
34 function () { 34 function () {
35 shouldBe("targetIframe1.contentDocument.webkitPointerLockElement", " targetDiv1"); 35 shouldBe("targetIframe1.contentDocument.pointerLockElement", "target Div1");
36 shouldBe("targetDiv1.parentElement.parentElement", "targetIframe1.co ntentDocument.body"); 36 shouldBe("targetDiv1.parentElement.parentElement", "targetIframe1.co ntentDocument.body");
37 expectOnlyErrorEvent("Remove targetDiv1's parent from iframe & immed iately lock target2. (main document handler)"); 37 expectOnlyErrorEvent("Remove targetDiv1's parent from iframe & immed iately lock target2. (main document handler)");
38 expectOnlyChangeEvent("Remove targetDiv1's parent from iframe & imme diately lock target2. (iframe handler)", targetIframe1.contentDocument); 38 expectOnlyChangeEvent("Remove targetDiv1's parent from iframe & imme diately lock target2. (iframe handler)", targetIframe1.contentDocument);
39 targetDiv1.parentElement.parentElement.removeChild(targetDiv1.parent Element); 39 targetDiv1.parentElement.parentElement.removeChild(targetDiv1.parent Element);
40 targetDiv2.requestPointerLock(); 40 targetDiv2.requestPointerLock();
41 shouldBe("document.webkitPointerLockElement", "null"); 41 shouldBe("document.pointerLockElement", "null");
42 shouldBe("targetDiv1.parentElement.parentElement", "null"); 42 shouldBe("targetDiv1.parentElement.parentElement", "null");
43 // doNextStep called by event handler. 43 // doNextStep called by event handler.
44 }, 44 },
45 function () { 45 function () {
46 // Absorb an extra doNextStep() from previous event handlers. 46 // Absorb an extra doNextStep() from previous event handlers.
47 }, 47 },
48 ]; 48 ];
49 doNextStep(); 49 doNextStep();
50 </script> 50 </script>
51 </body> 51 </body>
52 </html> 52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698