| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 // Blocked images can be reloaded, so neither onload nor onerror is called. | |
| 5 // Only check here that onload is never called when image is blocked. | |
| 6 | |
| 7 if (window.testRunner) { | |
| 8 testRunner.dumpAsText(); | |
| 9 testRunner.dumpPermissionClientCallbacks(); | |
| 10 } | |
| 11 | |
| 12 function log(a) | |
| 13 { | |
| 14 document.getElementById("results").innerHTML += a + "<br>"; | |
| 15 } | |
| 16 | |
| 17 function loaded() | |
| 18 { | |
| 19 log("PASS: first image loaded"); | |
| 20 if (window.testRunner && testRunner.setImagesAllowed) | |
| 21 testRunner.setImagesAllowed(false); | |
| 22 else | |
| 23 log("This test requires testRunner.setImagesAllowed, so it be can't run
in a browser."); | |
| 24 | |
| 25 // Load an image not in cache. | |
| 26 var img = document.createElement('img'); | |
| 27 img.onload = function () { log("FAIL: not cached image loaded"); } | |
| 28 img.src = "resources/boston.gif?nocache"; | |
| 29 document.getElementById("img").appendChild(img); | |
| 30 | |
| 31 // Load an image from cache. | |
| 32 var imgFromCache = document.createElement('img'); | |
| 33 imgFromCache.onload = function () { log("FAIL: image from cache loaded"); } | |
| 34 imgFromCache.src = "resources/boston.gif"; | |
| 35 document.getElementById("img").appendChild(imgFromCache); | |
| 36 | |
| 37 // Add an iframe with an image. | |
| 38 var iframe = document.createElement('iframe'); | |
| 39 iframe.src = "resources/image.html"; | |
| 40 document.getElementById("img").appendChild(iframe); | |
| 41 } | |
| 42 </script> | |
| 43 </head> | |
| 44 <body> | |
| 45 <img src="resources/boston.gif" onload="loaded()"> | |
| 46 <div id="img"></div> | |
| 47 <div id="results"></div> | |
| 48 </body> | |
| 49 </html> | |
| OLD | NEW |