Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Side by Side Diff: LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-broken-image-load.html

Issue 1047563002: Fire load event for an image even if it was the last image we loaded successfully. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698