| <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> |