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

Side by Side Diff: LayoutTests/fast/images/onload-event-when-reloading-image-after-successful-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 <script>
esprehn 2015/03/31 00:34:54 ditto
2 if (window.testRunner) {
3 testRunner.waitUntilDone();
4 testRunner.dumpAsText();
5 }
6 img = new Image();
7 var onloadCounter = 0;
8 var testImage = 'resources/green.jpg';
9 var resetImage = 'resources/green.jpg';
10 img.onload = function(){
11 onloadCounter++;
12 document.getElementById('console').innerHTML += "Image onload event fire d for " + img.src.substring(img.src.lastIndexOf('/') + 1) + "<br>";
13 if (onloadCounter == 2) {
14 document.getElementById('result').innerHTML = "PASS";
15 if (window.testRunner)
16 testRunner.notifyDone();
17 return;
18 }
19 if (onloadCounter == 1) {
20 setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0);
21 return;
22 }
23 document.getElementById('result').innerHTML = "FAIL";
24 };
25 setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0) ;
26 </script>
27 <div id="console">
28 crbug.com/469678: We should fire an image load event even if the image is the la st one we loaded successfully.<br>
29 In this test we load an image then we immediately launch an other request for th e same image - only one load event should be fired.<br>
30 Then we do the same again: another load event should be fired.<br>
31 </div>
32 <div id="result">FAIL</div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698