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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

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">
     2 <head>
     3 <title>bad manifest content type</title>
     5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     8 <script type="text/javascript">
    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   }
    21   ok(gotInvalidState, desc);
    22 }
    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)");
    30 expectInvalidState(function() { applicationCache.update(); },
    31                    "applicationCache.update should throw InvalidStateError");
    32 expectInvalidState(function() { applicationCache.swapCache(); },
    33                    "applicationCache.update should throw InvalidStateError");
    36 </script>
    38 </head>
    40 <body>
    42 </body>
    43 </html>

mercurial