Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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>
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" />
9 <script type="text/javascript">
11 var gGotChecking = false;
13 function finishTest() {
14 OfflineTest.teardownAndFinish();
15 }
17 function handleError() {
18 OfflineTest.ok(gGotChecking, "Expected checking event");
19 OfflineTest.ok(true, "Expected error event");
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 }
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;
39 // ... but expect 'checking' and 'error'
40 applicationCache.onchecking = function() { gGotChecking = true; };
41 applicationCache.onerror = OfflineTest.priv(handleError);
42 }
44 SimpleTest.waitForExplicitFinish();
46 </script>
48 </head>
50 <body>
52 </body>
53 </html>