summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/top-frame-2.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/top-frame-2.html')
-rw-r--r--LayoutTests/http/tests/appcache/top-frame-2.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/top-frame-2.html b/LayoutTests/http/tests/appcache/top-frame-2.html
new file mode 100644
index 0000000..c239d08
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/top-frame-2.html
@@ -0,0 +1,42 @@
+<html manifest="resources/subframes-2.manifest">
+<body>
+<p>Test that a subframe without manifest gets picked by a relevant application cache that
+contains its resource.</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 test()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // When a new main resource is associated with the cache, an update should be started.
+ applicationCache.onchecking = function() { log("checking") }
+
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "resources/subframe-2.html");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.onnoupdate = function() { test() }
+applicationCache.oncached = function() { test() }
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+
+window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+
+</script>
+</body>
+</html>