| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 // Setting WebKitDisplayImagesKey is asynchronous, so using queueReload and setI
nterval to check when the setting actually take effect. | |
| 5 | |
| 6 var intervalId; | |
| 7 var imageOnloadFired = 0; | |
| 8 | |
| 9 if (window.testRunner) { | |
| 10 testRunner.dumpAsText(); | |
| 11 window.internals.settings.setImagesEnabled(true); | |
| 12 testRunner.overridePreference('WebKitDisplayImagesKey', 0); | |
| 13 testRunner.queueReload(); | |
| 14 } | |
| 15 | |
| 16 function runTest() | |
| 17 { | |
| 18 var image = document.getElementById('image'); | |
| 19 if (image.naturalHeight != 0 || image.naturalWidth != 0 || imageOnloadFired
!= 0) { | |
| 20 document.getElementById('result').innerHTML = 'FAILURE: Image should not
be loaded when DisplayImage is unset'; | |
| 21 return; | |
| 22 } | |
| 23 | |
| 24 testRunner.overridePreference('WebKitDisplayImagesKey', 1); | |
| 25 document.getElementById('result').innerHTML = 'FAILURE: Image should reload
in-place when DispalyImage is changes from unset to set'; | |
| 26 testRunner.waitUntilDone(); | |
| 27 intervalId = window.setInterval(runTestRest, 10); | |
| 28 } | |
| 29 | |
| 30 function runTestRest() | |
| 31 { | |
| 32 var image = document.getElementById('image'); | |
| 33 if (image.naturalHeight == 33 && image.naturalWidth == 37 && imageOnloadFire
d == 1) { | |
| 34 document.getElementById('result').innerHTML = 'SUCCESS'; | |
| 35 window.clearInterval(intervalId); | |
| 36 testRunner.notifyDone(); | |
| 37 } | |
| 38 } | |
| 39 </script> | |
| 40 </head> | |
| 41 <body onload="runTest()"> | |
| 42 Test that DisplayImages disabled can block http image and can be reloaded in-p
lace when toggled. | |
| 43 <div id="result">FAILURE: Test script didn't run.</div> | |
| 44 <img id="image" src="../images/resources/oval.png" onload="imageOnloadFired=1;
"> | |
| 45 </body> | |
| 46 </html> | |
| 47 | |
| OLD | NEW |