Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html b/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| index f9c22460c0a0e2961549f16b9b12ef4015d8f30d..b6594ad32bd975c61964e3768fad2b5f8988d5d7 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| +++ b/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| @@ -1,30 +1,14 @@ |
| <!DOCTYPE html> |
| -<script src="../../resources/js-test.js"></script> |
| +<title>crbug.com/468915: Resetting or removing the src attribute should reset the image immediately, rather than waiting for an asynchronous load to do it.</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| <script> |
| - if (window.testRunner) { |
| - testRunner.waitUntilDone(); |
| - testRunner.dumpAsText(); |
| - } |
| - img = new Image(); |
| - var testImage = 'resources/green.jpg'; |
| - img.onload = function(){ |
| +async_test(function(t) { |
| + var img = new Image(); |
| + img.onload = t.step_func_done(function() { |
| img.removeAttribute('src'); |
| - if (img.naturalWidth > 0) { |
| - debug("Natural width is : " + img.naturalWidth + " and should be 0."); |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| - return; |
| - } |
| - document.getElementById('result').textContent = "PASS"; |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| - }; |
| - setTimeout(function() { |
| - img.src = testImage; |
| - }, 0); |
| + assert_equals(img.naturalWidth, 0); |
|
fs
2016/08/16 09:39:37
Maybe add an additional assert of img.naturalWidth
sivag
2016/08/16 10:06:40
Done.
|
| + }); |
| + img.src = 'resources/green.jpg'; |
| +}); |
| </script> |
| -<div id="console"> |
| - crbug.com/468915: Resetting or removing the src attribute should reset the image immediately, rather than waiting for an asynchronous load to do it.<br> |
| -</div> |
| -<div id="result">FAIL</div> |
| - |