blob: 2281a5294241e7c5a895cb94d09483790c53eb15 [file] [log] [blame]
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
testRunner.setCanOpenWindows(true);
testRunner.setCloseRemainingWindowsWhenComplete(true);
}
var maxEventLoopRuns = 50;
function helperLoaded () {
if (!maxEventLoopRuns) {
if (helper.location == "http://127.0.0.1:8000/contentextensions/resources/block-everything-unless-domain-helper.html")
console.log("PASS - blocked the load");
else
console.log("FAIL - loaded blocked URL");
testRunner.notifyDone();
} else {
setTimeout(helperLoaded, 1);
maxEventLoopRuns--;
}
}
var helper = window.open("resources/block-everything-unless-domain-helper.html");
if (helper)
helper.addEventListener('load', helperLoaded);
else {
console.log("opening window failed");
testRunner.notifyDone();
}
</script>