Chromium Code Reviews| Index: LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| diff --git a/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html b/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8f3c429d54f439b140717f001f46264c25455c7c |
| --- /dev/null |
| +++ b/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
| +<script> |
| +if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.dumpAsText(); |
| +} |
| +img = new Image(); |
| +var testImage = 'resources/green.jpg'; |
| +img.onload = function(){ |
| + img.removeAttribute('src'); |
| + if (img.naturalWidth > 0) { |
| + document.getElementById('result').textContent = "FAIL Natural width is : " + img.naturalWidth; |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + return; |
| + } |
| + document.getElementById('result').textContent = "PASS"; |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| +}; |
| +setTimeout("img.src = '" + testImage + "';", 0); |
|
esprehn
2015/04/06 20:29:40
don't use eval, use a closure.
|
| +</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> |
|
esprehn
2015/04/06 20:29:40
Would it be possible to use js-test.js instead?
|
| + |