summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/ajax/offline/test_bug544462.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/ajax/offline/test_bug544462.html')
-rw-r--r--dom/tests/mochitest/ajax/offline/test_bug544462.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/dom/tests/mochitest/ajax/offline/test_bug544462.html b/dom/tests/mochitest/ajax/offline/test_bug544462.html
new file mode 100644
index 000000000..1dbf9256c
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/test_bug544462.html
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest">
+<head>
+<title>wildcard in network section test</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>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+
+<style>
+ img {
+ max-width: 400px;
+ max-height: 400px;
+ }
+</style>
+
+<script type="text/javascript">
+
+var gImageLoaded = [];
+
+function imageOnLoad(idx)
+{
+ gImageLoaded[idx] = true;
+}
+
+function manifestUpdated()
+{
+ window.location.reload();
+}
+
+function finishTheTest()
+{
+ OfflineTest.is(gImageLoaded[1], true, "Image from a different origin not cointained in the offline cache has loaded");
+ OfflineTest.is(gImageLoaded[2], true, "Image not cointained in the offline cache has loaded");
+ OfflineTest.teardownAndFinish();
+}
+
+if (OfflineTest.setup()) {
+ applicationCache.onerror = OfflineTest.failEvent;
+ applicationCache.oncached = OfflineTest.priv(manifestUpdated);
+ applicationCache.onnoupdate = OfflineTest.priv(finishTheTest);
+}
+
+SimpleTest.waitForExplicitFinish();
+
+</script>
+
+</head>
+
+<body>
+ <img src="http://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" />
+ <img src="jupiter.jpg" onload="imageOnLoad(2)" />
+</body>
+</html>