summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resource-redirect-2.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/resource-redirect-2.html')
-rw-r--r--LayoutTests/http/tests/appcache/resource-redirect-2.html40
1 files changed, 40 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/resource-redirect-2.html b/LayoutTests/http/tests/appcache/resource-redirect-2.html
new file mode 100644
index 0000000..cf0d3a8
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resource-redirect-2.html
@@ -0,0 +1,40 @@
+<html manifest="resources/resource-redirect-2.manifest">
+<body>
+<p>Test that a redirect makes resource caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An unexpected event was dispatched on window.applicationCache.");
+}
+
+function test()
+{
+ // Wait for cache update to finish.
+ if (window.applicationCache.status != window.applicationCache.UNCACHED)
+ log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
+ else
+ log("SUCCESS");
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</body>
+</html>