Index: third_party/WebKit/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html |
diff --git a/third_party/WebKit/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html b/third_party/WebKit/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html |
index 537c6efb91af141365a9f862fb066e32ecbe004f..f313daf8d86f313e3f4abbd0fb01bcf98dd1aa55 100644 |
--- a/third_party/WebKit/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html |
+++ b/third_party/WebKit/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html |
@@ -1,39 +1,27 @@ |
<!DOCTYPE html> |
-<script src="../../resources/js-test.js"></script> |
+<title>crbug.com/469678: We should fire an image load event even if the image is the last one we loaded successfully. In this test we load an image. Then we make a request for a broken image which doesn't get the chance to complete before we attempt to load the same image again.</title> |
fs
2016/08/16 10:54:59
I'd suggest trying to make <title> contain a summa
sivag
2016/08/16 13:44:03
Done.
|
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<script> |
- if (window.testRunner) { |
- testRunner.waitUntilDone(); |
- testRunner.dumpAsText(); |
- } |
- img = new Image(); |
+async_test(function(t) { |
+ var img = new Image(); |
var onloadCounter = 0; |
fs
2016/08/16 10:54:59
We could probably get rid of this and instead rese
sivag
2016/08/16 13:44:03
Done.
|
var testImage = 'resources/green.jpg'; |
var resetImage = 'resources/bad-png.png'; |
- img.onload = function(){ |
+ img.src= resetImage; |
fs
2016/08/16 10:54:59
Nit: Space before =
sivag
2016/08/16 13:44:02
Done.
|
+ img.src = testImage; |
+ img.onload = t.step_func(function() { |
onloadCounter++; |
- debug("Image onload event fired for " + img.src.substring(img.src.lastIndexOf('/') + 1)); |
if (onloadCounter == 2) { |
- document.getElementById('result').textContent = "PASS"; |
- if (window.testRunner) |
- testRunner.notifyDone(); |
+ t.done(); |
return; |
} |
if (onloadCounter == 1) { |
- setTimeout(function() { |
- img.src= resetImage; |
- img.src = testImage; |
- }, 0); |
+ img.src= resetImage; |
fs
2016/08/16 10:54:59
Nit: Space before =
sivag
2016/08/16 13:44:03
Done.
|
+ img.src = testImage; |
return; |
} |
- document.getElementById('result').textContent = "FAIL"; |
- }; |
- setTimeout(function() { |
- 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 request for a broken image which doesn't get the chance to complete before we attempt to load the same image again.<br> |
-</div> |
-<div id="result">FAIL</div> |
+ |
fs
2016/08/16 10:54:59
Nit: Drop blank line
sivag
2016/08/16 13:44:03
Done.
|