2 <script src='../resources/js-test.js'
></script>
6 description("Blocked images can be reloaded, so neither onload nor onerror is called. Only check here that onload is never called when image is blocked.");
9 testRunner
.dumpPermissionClientCallbacks();
11 document
.write('<img src="resources/boston.gif" onload="loaded()">');
15 debug("PASS: first image loaded");
16 if (window
.testRunner
&& testRunner
.setImagesAllowed
)
17 testRunner
.setImagesAllowed(false);
19 debug("This test requires testRunner.setImagesAllowed, so it be can't run in a browser.");
21 // Load an image not in cache.
22 var img
= document
.createElement('img');
23 img
.onload = function () { log("FAIL: not cached image loaded"); }
24 img
.src
= "resources/boston.gif?nocache";
25 document
.getElementById("img").appendChild(img
);
27 // Load an image from cache.
28 var imgFromCache
= document
.createElement('img');
29 imgFromCache
.onload = function () { log("FAIL: image from cache loaded"); }
30 imgFromCache
.src
= "resources/boston.gif";
31 document
.getElementById("img").appendChild(imgFromCache
);
33 // Add an iframe with an image.
34 var iframe
= document
.createElement('iframe');
35 iframe
.src
= "resources/image.html";
36 document
.getElementById("img").appendChild(iframe
);
38 setTimeout(finishJSTest
, 0);