blob: 7d56f29ad359a1f0dcb7f513623aa36d4d9a6518 [file] [log] [blame]
<html manifest="resources/main-resource-redirect.manifest">
<body>
<p>Test that application cache is consulted again after a redirect response.</p>
<div id="result">Testing...</div>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function setNetworkEnabled(state)
{
var req = new XMLHttpRequest;
req.open("GET", "/resources/network-simulator.php?test=appcache-main-resource-main-resource-redirect&command=" + (state ? "connect" : "disconnect"), false);
req.send("");
}
function test()
{
applicationCache.oncached = null;
applicationCache.onnoupdate = null;
setNetworkEnabled(false);
var ifr = document.createElement("iframe");
ifr.setAttribute("src", "resources/main-resource-redirect-frame.php");
document.body.appendChild(ifr);
}
function done()
{
if (window.testRunner) {
applicationCache.onerror = null;
testRunner.notifyDone();
}
setNetworkEnabled(true);
}
applicationCache.oncached=test;
applicationCache.onnoupdate=test;
applicationCache.onerror = function() { setNetworkEnabled(true); window.location.reload(); }
</script>
</body>