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

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

Issue 1047803005: Allow the "img.src='';img.src='.." idiom to clear down images immediately. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
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 = '';
11 img.onload = function(){
12 onloadCounter++;
13 document.getElementById('console').textContent += "Image onload event fi red for " + img.src.substring(img.src.lastIndexOf('/') + 1) + "<br>";
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/04/06 20:29:40 function() { } don't use eval.
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 null request (img.src='') which sh ould clear down the image 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