summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html')
-rw-r--r--dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html84
1 files changed, 84 insertions, 0 deletions
diff --git a/dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html b/dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html
new file mode 100644
index 000000000..53955790d
--- /dev/null
+++ b/dom/tests/mochitest/ajax/offline/test_bug744719-cancel.html
@@ -0,0 +1,84 @@
+<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest">
+<head>
+<title>parallel load canceled</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" />
+
+<script type="text/javascript">
+
+/*
+ Manifest refers a large number of resource to load. The 10th item however is a reference to a non-existing
+ resource that cancels the load. This test checks we cancel all loads and don't leak any of the other resources
+ after cancelation.
+*/
+
+if (SpecialPowers.isMainProcess()) {
+ ok(applicationCache.mozItems.length == 0,
+ "applicationCache.mozItems should be available and empty before associating with a cache.");
+}
+
+function updateCanceled()
+{
+ OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest", false, null);
+ OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false, null);
+ OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false, null);
+
+ OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/nonexistent744719?010", false, null);
+
+ var URL = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/subresource744719.html?";
+ OfflineTest.checkCache(URL + "001", false, null);
+ OfflineTest.checkCache(URL + "002", false, null);
+ OfflineTest.checkCache(URL + "003", false, null);
+ OfflineTest.checkCache(URL + "004", false, null);
+ OfflineTest.checkCache(URL + "005", false, null);
+ OfflineTest.checkCache(URL + "006", false, null);
+ OfflineTest.checkCache(URL + "007", false, null);
+ OfflineTest.checkCache(URL + "008", false, null);
+ OfflineTest.checkCache(URL + "009", false, null);
+ OfflineTest.checkCache(URL + "011", false, null);
+ OfflineTest.checkCache(URL + "012", false, null);
+ OfflineTest.checkCache(URL + "013", false, null);
+ OfflineTest.checkCache(URL + "014", false, null);
+ OfflineTest.checkCache(URL + "015", false, null);
+ OfflineTest.checkCache(URL + "016", false, null);
+ OfflineTest.checkCache(URL + "017", false, null);
+ OfflineTest.checkCache(URL + "018", false, null);
+ OfflineTest.checkCache(URL + "019", false, null);
+ OfflineTest.checkCache(URL + "020", false, null);
+ OfflineTest.checkCache(URL + "021", false, null);
+ OfflineTest.checkCache(URL + "022", false, null);
+ OfflineTest.checkCache(URL + "023", false, null);
+ OfflineTest.checkCache(URL + "024", false, null);
+ OfflineTest.checkCache(URL + "025", false, null);
+ OfflineTest.checkCache(URL + "026", false, null);
+ OfflineTest.checkCache(URL + "027", false, null);
+ OfflineTest.checkCache(URL + "028", false, null);
+ OfflineTest.checkCache(URL + "029", false, null);
+ OfflineTest.checkCache(URL + "030", false, null);
+
+ OfflineTest.teardownAndFinish();
+}
+
+if (OfflineTest.setup()) {
+ // Wait some time after the update has been canceled to catch potential leaks of channels that would cause
+ // unwanted items to be cached regardless the update has been canceled with a failure.
+ var privUpdateCanceled = OfflineTest.priv(updateCanceled);
+ applicationCache.onerror = function() {window.setTimeout(privUpdateCanceled, 1000)};
+
+ // We don't expect this update to finish correctly.
+ applicationCache.oncached = OfflineTest.failEvent;
+}
+
+SimpleTest.waitForExplicitFinish();
+SimpleTest.requestFlakyTimeout("untriaged");
+
+</script>
+
+</head>
+
+<body>
+
+</body>
+</html>