Chromium Code Reviews| Index: LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html |
| diff --git a/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html b/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..691f26d25ed11323d5d45b2704e9587a365bb20b |
| --- /dev/null |
| +++ b/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html |
| @@ -0,0 +1,32 @@ |
| +<!DOCTYPE html> |
| +<script> |
| + if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.dumpAsText(); |
| + } |
| + img = new Image(); |
| + var onloadCounter = 0; |
| + var testImage = 'resources/green.jpg'; |
| + var resetImage = ''; |
| + img.onload = function(){ |
| + onloadCounter++; |
| + document.getElementById('console').textContent += "Image onload event fired for " + img.src.substring(img.src.lastIndexOf('/') + 1) + "<br>"; |
| + if (onloadCounter == 2) { |
| + document.getElementById('result').textContent = "PASS"; |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + return; |
| + } |
| + if (onloadCounter == 1) { |
| + setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0); |
|
esprehn
2015/04/06 20:29:40
function() { }
don't use eval.
|
| + return; |
| + } |
| + document.getElementById('result').textContent = "FAIL"; |
| + }; |
| + setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0); |
| +</script> |
| +<div id="console"> |
| +crbug.com/469678: We should fire an image load event even if the image is the last one we loaded successfully.<br> |
| +In this test we load an image. Then we make a null request (img.src='') which should clear down the image before we attempt to load the same image again.<br> |
| +</div> |
| +<div id="result">FAIL</div> |