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 locking an element not in a document is rejected and pointerlockerror event dispatched.")
13 window
.jsTestIsAsync
= true;
15 targetDiv1
= document
.getElementById("target1");
19 shouldNotBe("targetDiv1.parentElement", "null");
20 expectOnlyErrorEvent("Remove targetDiv1 from document, and try to lock it.");
21 targetDiv1
.parentElement
.removeChild(targetDiv1
);
22 shouldBe("targetDiv1.parentElement", "null");
23 targetDiv1
.requestPointerLock();
24 // doNextStep called by event handler.
27 doNextStepWithUserGesture();