summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/main-resource-redirect.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/main-resource-redirect.html')
-rw-r--r--LayoutTests/http/tests/appcache/main-resource-redirect.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/main-resource-redirect.html b/LayoutTests/http/tests/appcache/main-resource-redirect.html
new file mode 100644
index 0000000..3ede636
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/main-resource-redirect.html
@@ -0,0 +1,39 @@
+<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>