blob: fe7eb4bf10310fd85d95c98b77438e297a3dd817 [file] [log] [blame]
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function loadNextPage() {
// Navigating to another location invokes the unload handler
location.href = "resources/redirect.php?to=" +
encodeURIComponent(
"/contentextensions/resources/get-ping-data.php?" +
"test=contentextensions-block-image-load-in-onunload&" +
"timeout_ms=1000&" +
"end_test=1");
// Why timeout_ms=1000:
// To pass the test, the ping shouldn't arrive, so we need to
// timeout at some point. We don't have to wait too long because
// the console message can tell us whether the ping was blocked.
}
function loadImage() {
var img = new Image(1, 1);
img.src = "resources/save-ping.php?test=contentextensions-block-image-load-in-onunload";
}
</script>
</head>
<body onunload="loadImage();">
This test loads an image in onunload, where the image URL matches a 'block' rule.
<img src="resources/delete-ping.php?test=contentextensions-block-image-load-in-onunload" onerror="loadNextPage();">
</body>