summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/pointer-lock/pointerlockelement-null-when-pending.html
blob: bf399b4d70f10aff57b7f8499057ce3bf6541d4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../http/tests/resources/pointer-lock/pointer-lock-test-harness.js"></script>
</head>
<body>
<div>
  <div id="target1"></div>
</div>
<script>
    description("Test pointerLockElement is null when a lock is pending.")
    window.jsTestIsAsync = true;

    targetDiv1 = document.getElementById("target1");

    todo = [
        function () {
            shouldBe("document.webkitPointerLockElement", "null");
            testRunner.setPointerLockWillRespondAsynchronously();
            expectOnlyChangeEvent("Lock.");
            targetDiv1.webkitRequestPointerLock();
            doNextStep();
        },
        function () {
            shouldBe("document.webkitPointerLockElement", "null");
            testRunner.didAcquirePointerLock();
            // doNextStep called from event handler set with expect...
        },
        function () {
            shouldBe("document.webkitPointerLockElement", "targetDiv1");
            expectOnlyChangeEvent("Unlock.");
            document.webkitExitPointerLock();
            shouldBe("document.webkitPointerLockElement", "targetDiv1");
            // doNextStep called from event handler set with expect...
        },
        function () {
            shouldBe("document.webkitPointerLockElement", "null");
            doNextStep();
        },
    ];
    doNextStep();
</script>
</body>
</html>