blob: 34b4828708d44a1cbc1eeae756c9a9a41897aeca [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Accessing Navigator sendBeacon methods on a closed window.");
window.jsTestIsAsync = true;
var w;
function processMessage(event) {
if (event.data == "opened") {
otherNavigator = w.navigator;
w.close();
} else if (event.data == "closed") {
shouldThrowErrorName("otherNavigator.sendBeacon()", "TypeError");
shouldBeFalse("otherNavigator.sendBeacon('resources/blank.txt')");
finishJSTest();
}
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.waitUntilDone();
}
w = window.open('/js-test-resources/window-postmessage-open-close.html');
window.addEventListener("message", processMessage, false);
</script>