blob: 3ede636a59ab34d63357c161815bb61e44b56d38 [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.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpAsText();
}
function setNetworkEnabled(state)
{
var req = new XMLHttpRequest;
req.open("GET", "/resources/network-simulator.php?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.layoutTestController)
layoutTestController.notifyDone();
setNetworkEnabled(true);
}
applicationCache.oncached=test;
applicationCache.onnoupdate=test;
applicationCache.onerror = function() { setNetworkEnabled(true); window.location.reload(); }
</script>
</body>