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 onloadCounter = 0; | |
9 var testImage = 'resources/green.jpg'; | |
10 var resetImage = 'resources/bad-png.png'; | |
11 img.onload = function(){ | |
12 onloadCounter++; | |
13 document.getElementById('console').innerHTML += "Image onload event fire d for " + img.src.substring(img.src.lastIndexOf('/') + 1) + "<br>"; | |
esprehn
2015/03/31 21:53:21
Why not just use js-test.js and then you can use d
| |
14 if (onloadCounter == 2) { | |
15 document.getElementById('result').textContent = "PASS"; | |
16 if (window.testRunner) | |
17 testRunner.notifyDone(); | |
18 return; | |
19 } | |
20 if (onloadCounter == 1) { | |
21 setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0); | |
esprehn
2015/03/31 21:53:21
don't use the eval, use a function.
| |
22 return; | |
23 } | |
24 document.getElementById('result').textContent = "FAIL"; | |
25 }; | |
26 setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0) ; | |
27 </script> | |
28 <div id="console"> | |
29 crbug.com/469678: We should fire an image load event even if the image is the la st one we loaded successfully.<br> | |
30 In this test we load an image. Then we make a request for a broken image which d oesn't get the chance to complete before we attempt to load the same image again .<br> | |
31 </div> | |
32 <div id="result">FAIL</div> | |
OLD | NEW |