blob: ba3bee3cd4f8f3e4ed6f6c9474a66e5f4c5a2c52 [file] [log] [blame]
<html>
<head>
<script>
// Setting loadsImagesAutomatically is asynchronous, so using queueReload and setInterval to check when the setting actually take effect.
var intervalId;
var imageOnloadFired = 0;
if (window.testRunner) {
testRunner.dumpAsText();
internals.settings.setImagesEnabled(true);
internals.settings.setLoadsImagesAutomatically(false);
testRunner.queueReload();
}
function runTest()
{
var image = document.getElementById('image');
if (image.naturalHeight != 0 || image.naturalWidth != 0 || imageOnloadFired != 0) {
document.getElementById('result').innerHTML = 'FAILURE: Image should not be loaded when loadsImagesAutomatically is unset';
return;
}
internals.settings.setLoadsImagesAutomatically(true);
document.getElementById('result').innerHTML = 'FAILURE: Image should reload in-place when loadsImagesAutomatically is changes from unset to set';
testRunner.waitUntilDone();
intervalId = window.setInterval(runTestRest, 10);
}
function runTestRest()
{
var image = document.getElementById('image');
if (image.naturalHeight == 33 && image.naturalWidth == 37 && imageOnloadFired == 1) {
document.getElementById('result').innerHTML = 'SUCCESS';
window.clearInterval(intervalId);
testRunner.notifyDone();
}
}
</script>
</head>
<body onload="runTest()">
Test that DisplayImages disabled can block http image and can be reloaded in-place when toggled.
<div id="result">FAILURE: Test script didn't run.</div>
<img id="image" src="../images/resources/oval.png" onload="imageOnloadFired=1;">
</body>
</html>