| <head> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| function deletePing() { |
| var deletePingContainer = document.getElementById("delete_ping_container"); |
| deletePingContainer.innerHTML = '<img src="resources/delete-ping.php?test=contentextensions-block-cookies-in-image-load-in-onunload" onerror="loadNextPage();">'; |
| } |
| |
| 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-cookies-in-image-load-in-onunload&" + |
| "end_test=1"); |
| } |
| |
| function loadImage() { |
| var img = new Image(1, 1); |
| img.src = "resources/save-ping.php?test=contentextensions-block-cookies-in-image-load-in-onunload"; |
| } |
| </script> |
| </head> |
| |
| <body onunload="loadImage();"> |
| This test sets a cookie, then loads an image in onunload, where the image URL matches a 'block-cookie' rule. |
| <img src="http://127.0.0.1:8000/cookies/resources/cookie-utility.php?queryfunction=setFooCookie" |
| onerror="deletePing();"> |
| <div id="delete_ping_container"></div> |
| </body> |
| |