summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/ajax/offline/updatingImplicit.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/ajax/offline/updatingImplicit.html')
-rw-r--r--dom/tests/mochitest/ajax/offline/updatingImplicit.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/dom/tests/mochitest/ajax/offline/updatingImplicit.html b/dom/tests/mochitest/ajax/offline/updatingImplicit.html
new file mode 100644
index 000000000..6e95b4084
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/updatingImplicit.html
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
+<head>
+<title>Updating implicit</title>
+
+<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
+
+<script type="text/javascript">
+
+function manifestUpdated()
+{
+ // Assert that we are properly associated with the application
+ // cache.
+ var req = new XMLHttpRequest;
+ req.open("GET", "namespace2/script3.js", false);
+ try {
+ req.send(null);
+ window.opener.OfflineTest.ok(false, "Able to fetch unlisted resource, not properly associated.");
+ } catch(ex) {
+ window.opener.OfflineTest.ok(true, "Unable to fetch unlisted resource, properly associated.");
+ }
+
+ req = new XMLHttpRequest;
+ req.open("GET", "updatingImplicit.html", false);
+ try {
+ req.send(null);
+ window.opener.OfflineTest.ok(true, "Able to fetch listed resource, properly associated.");
+ } catch(ex) {
+ window.opener.OfflineTest.ok(false, "Unable to fetch listed resource, not properly associated.");
+ }
+
+ window.opener.implicitLoaded(window, false);
+}
+
+function manifestError()
+{
+ window.opener.implicitLoaded(window, true);
+}
+
+if (OfflineTest.setupChild()) {
+ applicationCache.onerror = OfflineTest.priv(manifestError);
+ applicationCache.onupdateready = OfflineTest.failEvent;
+ applicationCache.oncached = OfflineTest.failEvent;
+ applicationCache.onnoupdate = OfflineTest.priv(manifestUpdated);
+}
+
+</script>
+
+</head>
+
+<body>
+</body>
+</html>