summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html')
-rw-r--r--LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html
new file mode 100644
index 0000000..57093fa
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/resources/xhr-foreign-resource-frame.html
@@ -0,0 +1,36 @@
+<html manifest="xhr-foreign-resource-2.manifest">
+<body>
+<div id=result></div>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cached()
+{
+ applicationCache.onnoupdate = null;
+ applicationCache.oncached = null;
+
+ // simple.txt is only listed s a resource in main frame's manifest, so loading should fail.
+ try {
+ var req = new XMLHttpRequest;
+ req.open("GET", "simple.txt", false);
+ req.send("");
+ log("FAIL");
+ log("applicationCache.status = " + applicationCache.status);
+ parent.postMessage("FAIL", "*");
+ } catch (ex) {
+ log("Frame OK");
+ parent.postMessage("SUCCESS", "*");
+ }
+}
+
+applicationCache.onnoupdate = cached;
+applicationCache.oncached = cached;
+
+applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
+applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
+</script>
+</body>
+</html>