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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html
diff --git a/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html b/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html
new file mode 100644
index 0000000000000000000000000000000000000000..691f26d25ed11323d5d45b2704e9587a365bb20b
--- /dev/null
+++ b/LayoutTests/fast/images/onload-event-when-reloading-image-after-interrupted-null-src-load.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+ img = new Image();
+ var onloadCounter = 0;
+ var testImage = 'resources/green.jpg';
+ var resetImage = '';
+ img.onload = function(){
+ onloadCounter++;
+ document.getElementById('console').textContent += "Image onload event fired for " + img.src.substring(img.src.lastIndexOf('/') + 1) + "<br>";
+ if (onloadCounter == 2) {
+ document.getElementById('result').textContent = "PASS";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return;
+ }
+ if (onloadCounter == 1) {
+ setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0);
esprehn 2015/04/06 20:29:40 function() { } don't use eval.
+ return;
+ }
+ document.getElementById('result').textContent = "FAIL";
+ };
+ setTimeout("img.src='" + resetImage + "';img.src = '" + testImage + "';", 0);
+</script>
+<div id="console">
+crbug.com/469678: We should fire an image load event even if the image is the last one we loaded successfully.<br>
+In this test we load an image. Then we make a null request (img.src='') which should clear down the image before we attempt to load the same image again.<br>
+</div>
+<div id="result">FAIL</div>

Powered by Google App Engine
This is Rietveld 408576698