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

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:31e66296b9d2
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <title>bad manifest content type</title>
4
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
7
8 <script type="text/javascript">
9
10 function expectInvalidState(fn, desc) {
11 var gotInvalidState = false;
12 try {
13 fn();
14 } catch(e) {
15 if (e.name == "InvalidStateError" &&
16 e.code == DOMException.INVALID_STATE_ERR) {
17 gotInvalidState = true;
18 }
19 }
20
21 ok(gotInvalidState, desc);
22 }
23
24 is(typeof(applicationCache), "object");
25 if (SpecialPowers.isMainProcess()) {
26 is(applicationCache.mozLength, 0, "applicationCache.mozLength should be 0");
27 }
28 is(applicationCache.status, 0, "applicationCache.status should be 0 (UNCACHED)");
29
30 expectInvalidState(function() { applicationCache.update(); },
31 "applicationCache.update should throw InvalidStateError");
32 expectInvalidState(function() { applicationCache.swapCache(); },
33 "applicationCache.update should throw InvalidStateError");
34
35
36 </script>
37
38 </head>
39
40 <body>
41
42 </body>
43 </html>

mercurial