| 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-prefixed.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="http://localhost:8080/resources/pointer-lock/inner-iframe.html" o
nload="doNextStepWithUserGesture()"></iframe> | 10 <iframe src="http://localhost:8080/resources/pointer-lock/inner-iframe-prefixe
d.html" onload="doNextStepWithUserGesture()"></iframe> |
| 11 </div> | 11 </div> |
| 12 <script> | 12 <script> |
| 13 description("Test iframe from different origin can not access webkitPointerL
ockElement.") | 13 description("Test iframe from different origin can not access webkitPointerL
ockElement.") |
| 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 expectOnlyChangeEvent("Lock targetDiv1."); | 21 expectOnlyChangeEvent("Lock targetDiv1."); |
| 22 targetDiv1.webkitRequestPointerLock(); | 22 targetDiv1.webkitRequestPointerLock(); |
| 23 // doNextStep called by event handler. | 23 // doNextStep called by event handler. |
| 24 }, | 24 }, |
| 25 function () { | 25 function () { |
| 26 shouldBe("document.webkitPointerLockElement", "targetDiv1"); | 26 shouldBe("document.webkitPointerLockElement", "targetDiv1"); |
| 27 doNextStep(); | 27 doNextStep(); |
| 28 }, | 28 }, |
| 29 function () { | 29 function () { |
| 30 iframe.contentWindow.postMessage(["eval", 'parent.postMessage(thisFile
Name() + " document.webkitPointerLockElement = " + document.webkitPointerLockEle
ment, "*")'], "*"); | 30 iframe.contentWindow.postMessage(["eval", 'parent.postMessage(thisFile
Name() + " document.webkitPointerLockElement = " + document.webkitPointerLockEle
ment, "*")'], "*"); |
| 31 window.onmessage = function (messageEvent) { | 31 window.onmessage = function (messageEvent) { |
| 32 message = messageEvent.data; | 32 message = messageEvent.data; |
| 33 shouldBeEqualToString("message", "inner-iframe.html document.webki
tPointerLockElement = null"); | 33 shouldBeEqualToString("message", "inner-iframe-prefixed.html docum
ent.webkitPointerLockElement = null"); |
| 34 window.onmessage = null; | 34 window.onmessage = null; |
| 35 doNextStep(); | 35 doNextStep(); |
| 36 } | 36 } |
| 37 }, | 37 }, |
| 38 ]; | 38 ]; |
| 39 // doNextStep() called by iframe onload handler. | 39 // doNextStep() called by iframe onload handler. |
| 40 </script> | 40 </script> |
| 41 </body> | 41 </body> |
| 42 </html> | 42 </html> |
| OLD | NEW |