dom/tests/mochitest/ajax/offline/test_missingFile.html

branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
equal deleted inserted replaced
-1:000000000000 0:87e0d8ff5987
1 <html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest">
2 <head>
3 <title>missing manifest file test</title>
4
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8
9 <script type="text/javascript">
10
11 var gGotChecking = false;
12 var gGotDownloading = false;
13
14 function finishTest() {
15 OfflineTest.teardownAndFinish();
16 }
17
18 function handleError() {
19 OfflineTest.ok(gGotChecking, "Expected checking event");
20 OfflineTest.ok(gGotDownloading, "Expected downloading event");
21 OfflineTest.ok(true, "Expected error event");
22
23 // These items are listed in the manifest, but the error should have
24 // prevented them from being committed to the cache.
25 var entries = [
26 ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false],
27 ["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false]
28 ];
29 OfflineTest.checkCacheEntries(entries, finishTest);
30 }
31
32 if (OfflineTest.setup()) {
33 // Don't expect any "success" events.
34 applicationCache.onupdateready = function() { OfflineTest.failEvent("updateready"); }
35 applicationCache.oncached = function() { OfflineTest.failEvent("cached"); }
36 applicationCache.onnoupdate = function() { OfflineTest.failEvent("noupdate"); }
37
38 applicationCache.ondownloading = function() { gGotDownloading = true; };
39 applicationCache.onchecking = function() { gGotChecking = true; };
40 applicationCache.onerror = OfflineTest.priv(handleError);
41 }
42
43 SimpleTest.waitForExplicitFinish();
44
45
46 </script>
47
48 </head>
49
50 <body>
51
52 </body>
53 </html>

mercurial