4 <script src=
"../resources/js-test.js"></script>
5 <script src=
"../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
9 <div id=
"target1"></div>
12 description("Test that pointerlockchange event is dispatched when lock is lost.")
13 window
.jsTestIsAsync
= true;
14 shouldBeDefined("window.testRunner");
16 targetDiv1
= document
.getElementById("target1");
20 expectOnlyChangeEvent("Lock targetDiv1.");
21 targetDiv1
.requestPointerLock();
22 // doNextStep called by event handler.
25 shouldBe("document.pointerLockElement", "targetDiv1");
26 expectOnlyChangeEvent("Host initiated unlock.");
27 testRunner
.didLosePointerLock();
28 // doNextStep called by event handler.
31 shouldBe("document.pointerLockElement", "null");
35 doNextStepWithUserGesture();