summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/vibration/vibration-detached-no-crash.html
blob: 7e0de30d42831b7ab5aec3aa758a641a9c50fc8c (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
<!DOCTYPE HTML>
<body>
<head>
<script src="../resources/js-test.js"></script>
<script src="vibration-utils.js"></script>
</head>
<script>
description("Accessing navigator.vibrate on a closed window.");

window.jsTestIsAsync = true;

var w;
function processMessage(event) {
    if (event.data == "opened") {
        w.close();
    } else if (event.data == "closed") {
        shouldBeFalse("w.navigator.vibrate([])");
        finishJSTest();
    }
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.setCanOpenWindows();
}
w = window.open('../resources/window-postmessage-open-close.html');
window.addEventListener("message", processMessage, false);
</script>
</body>