4 <script src=
"/js-test-resources/js-test.js"></script>
6 description("Accessing Navigator sendBeacon methods on a closed window.");
8 window
.jsTestIsAsync
= true;
11 function processMessage(event
) {
12 if (event
.data
== "opened") {
14 } else if (event
.data
== "closed") {
15 shouldThrow("w.navigator.sendBeacon()");
16 shouldBeFalse("w.navigator.sendBeacon('resources/blank.txt', 'detached-should-return false')");
21 if (window
.testRunner
) {
22 testRunner
.dumpAsText();
23 testRunner
.setCanOpenWindows();
24 testRunner
.waitUntilDone();
26 w
= window
.open('/js-test-resources/window-postmessage-open-close.html');
27 window
.addEventListener("message", processMessage
, false);