Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script> | |
| 3 if (window.testRunner) { | |
| 4 testRunner.waitUntilDone(); | |
| 5 testRunner.dumpAsText(); | |
| 6 } | |
| 7 img = new Image(); | |
| 8 var testImage = 'resources/green.jpg'; | |
| 9 img.onload = function(){ | |
| 10 img.removeAttribute('src'); | |
| 11 if (img.naturalWidth > 0) { | |
| 12 document.getElementById('result').textContent = "FAIL Natural width is : " + img.naturalWidth; | |
| 13 if (window.testRunner) | |
| 14 testRunner.notifyDone(); | |
| 15 return; | |
| 16 } | |
| 17 document.getElementById('result').textContent = "PASS"; | |
| 18 if (window.testRunner) | |
| 19 testRunner.notifyDone(); | |
| 20 }; | |
| 21 setTimeout("img.src = '" + testImage + "';", 0); | |
|
esprehn
2015/04/06 20:29:40
don't use eval, use a closure.
| |
| 22 </script> | |
| 23 <div id="console"> | |
| 24 crbug.com/468915: Resetting or removing the src attribute should reset the i mage immediately, rather than waiting for an asynchronous load to do it.<br> | |
| 25 </div> | |
| 26 <div id="result">FAIL</div> | |
|
esprehn
2015/04/06 20:29:40
Would it be possible to use js-test.js instead?
| |
| 27 | |
| OLD | NEW |