OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="/js-test-resources/js-test.js"></script> | 4 <script src="/js-test-resources/js-test.js"></script> |
5 <script src="../resources/pointer-lock/pointer-lock-test-harness.js"></script> | 5 <script src="../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 <iframe src="../resources/pointer-lock/iframe-allows-inner-iframe.html" sandbo
x="allow-pointer-lock allow-scripts" onload="doNextStepWithUserGesture()"></ifra
me> | 10 <iframe src="../resources/pointer-lock/iframe-allows-inner-iframe.html" sandbo
x="allow-pointer-lock allow-scripts" onload="doNextStepWithUserGesture()"></ifra
me> |
11 </div> | 11 </div> |
12 <script> | 12 <script> |
13 description("Test nested sandboxed iframes with allow-pointer-lock allow poi
nter lock."); | 13 description("Test nested sandboxed iframes with allow-pointer-lock allow poi
nter lock."); |
14 window.jsTestIsAsync = true; | 14 window.jsTestIsAsync = true; |
15 | 15 |
16 targetDiv1 = document.getElementById("target1"); | 16 targetDiv1 = document.getElementById("target1"); |
17 iframe = document.getElementsByTagName("iframe")[0]; | 17 iframe = document.getElementsByTagName("iframe")[0]; |
18 | 18 |
19 todo = [ | 19 todo = [ |
20 function () { | 20 function () { |
21 iframe.contentWindow.postMessage(["pass message down", "eval", 'docume
nt.body.webkitRequestPointerLock()'], "*"); | 21 iframe.contentWindow.postMessage(["pass message down", "eval", 'docume
nt.body.requestPointerLock()'], "*"); |
22 window.onmessage = function (messageEvent) { | 22 window.onmessage = function (messageEvent) { |
23 message = messageEvent.data; | 23 message = messageEvent.data; |
24 shouldBeEqualToString("message", "inner-iframe.html onpointerlockc
hange, document.webkitPointerLockElement = [object HTMLBodyElement]"); | 24 shouldBeEqualToString("message", "inner-iframe.html onpointerlockc
hange, document.pointerLockElement = [object HTMLBodyElement]"); |
25 window.onmessage = null; | 25 window.onmessage = null; |
26 doNextStep(); | 26 doNextStep(); |
27 } | 27 } |
28 }, | 28 }, |
29 ]; | 29 ]; |
30 // doNextStep() called by iframe onload handler. | 30 // doNextStep() called by iframe onload handler. |
31 </script> | 31 </script> |
32 </body> | 32 </body> |
33 </html> | 33 </html> |
OLD | NEW |