summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/foreign-iframe-main.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/foreign-iframe-main.html')
-rw-r--r--LayoutTests/http/tests/appcache/foreign-iframe-main.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/foreign-iframe-main.html b/LayoutTests/http/tests/appcache/foreign-iframe-main.html
new file mode 100644
index 0000000..a543eef
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/foreign-iframe-main.html
@@ -0,0 +1,39 @@
+<html manifest="resources/foreign-iframe.manifest"> <!-- Any manifest would do the trick. -->
+<body>
+<p>Test for <a href="rdar://problem/6284708">&lt;rdar://problem/6284708></a> AppCache crashes in ApplicationCacheResource::addType().</p>
+
+<div id=result></div>
+
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function test()
+{
+ var ifr = document.createElement("iframe");
+ ifr.setAttribute("src", "http://localhost:8000/appcache/resources/foreign-iframe.html");
+ document.body.appendChild(ifr);
+}
+
+applicationCache.addEventListener('checking', function() { log("checking") }, false);
+applicationCache.addEventListener('error', function() { log("error") }, false);
+applicationCache.addEventListener('downloading', function() { log("downloading") }, false);
+applicationCache.addEventListener('progress', function() { log("progress") }, false);
+applicationCache.addEventListener('updateready', function() { log("updateready") }, false);
+applicationCache.addEventListener('obsolete', function() { log("obsolete") }, false);
+
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); test() }, false);
+applicationCache.addEventListener('cached', function() { log("cached"); test() }, false);
+
+window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
+
+</script>
+</body>
+</html>