4 <script src=
"/js-test-resources/js-test.js"></script>
5 <script src=
"../resources/pointer-lock/pointer-lock-test-harness.js"></script>
9 <div id=
"target1"></div>
10 <iframe src=
"http://localhost:8080/resources/pointer-lock/inner-iframe.html" onload=
"doNextStepWithUserGesture()"></iframe>
13 description("Test iframe from different origin can not access pointerLockElement.")
14 window
.jsTestIsAsync
= true;
16 targetDiv1
= document
.getElementById("target1");
17 iframe
= document
.getElementsByTagName("iframe")[0];
21 expectOnlyChangeEvent("Lock targetDiv1.");
22 targetDiv1
.requestPointerLock();
23 // doNextStep called by event handler.
26 shouldBe("document.pointerLockElement", "targetDiv1");
30 iframe
.contentWindow
.postMessage(["eval", 'parent.postMessage(thisFileName() + " document.pointerLockElement = " + document.pointerLockElement, "*")'], "*");
31 window
.onmessage = function (messageEvent
) {
32 message
= messageEvent
.data
;
33 shouldBeEqualToString("message", "inner-iframe.html document.pointerLockElement = null");
34 window
.onmessage
= null;
39 // doNextStep() called by iframe onload handler.