|
1 <html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest"> |
|
2 <head> |
|
3 <title>bad manifest magic</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 |
|
13 function finishTest() { |
|
14 OfflineTest.teardownAndFinish(); |
|
15 } |
|
16 |
|
17 function handleError() { |
|
18 OfflineTest.ok(gGotChecking, "Expected checking event"); |
|
19 OfflineTest.ok(true, "Expected error event"); |
|
20 |
|
21 // These items are listed in the manifest, but the error should have |
|
22 // prevented them from being committed to the cache. |
|
23 var entries = [ |
|
24 ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false], |
|
25 ["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false] |
|
26 ]; |
|
27 OfflineTest.checkCacheEntries(entries, finishTest); |
|
28 } |
|
29 |
|
30 |
|
31 if (OfflineTest.setup()) { |
|
32 // Don't expect a bunch of events. |
|
33 applicationCache.ondownloading = OfflineTest.failEvent; |
|
34 applicationCache.onupdateready = OfflineTest.failEvent; |
|
35 applicationCache.oncached = OfflineTest.failEvent; |
|
36 applicationCache.onnoupdate = OfflineTest.failEvent; |
|
37 applicationCache.onprogress = OfflineTest.failEvent; |
|
38 |
|
39 // ... but expect 'checking' and 'error' |
|
40 applicationCache.onchecking = function() { gGotChecking = true; }; |
|
41 applicationCache.onerror = OfflineTest.priv(handleError); |
|
42 } |
|
43 |
|
44 SimpleTest.waitForExplicitFinish(); |
|
45 |
|
46 </script> |
|
47 |
|
48 </head> |
|
49 |
|
50 <body> |
|
51 |
|
52 </body> |
|
53 </html> |