dom/tests/mochitest/ajax/offline/updatingImplicit.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" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
     2 <head>
     3 <title>Updating implicit</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>
     8 <script type="text/javascript">
    10 function manifestUpdated()
    11 {
    12   // Assert that we are properly associated with the application
    13   // cache.
    14   var req = new XMLHttpRequest;
    15   req.open("GET", "namespace2/script3.js", false);
    16   try {
    17     req.send(null);
    18     window.opener.OfflineTest.ok(false, "Able to fetch unlisted resource, not properly associated.");
    19   } catch(ex) {
    20     window.opener.OfflineTest.ok(true, "Unable to fetch unlisted resource, properly associated.");
    21   }
    23   req = new XMLHttpRequest;
    24   req.open("GET", "updatingImplicit.html", false);
    25   try {
    26     req.send(null);
    27     window.opener.OfflineTest.ok(true, "Able to fetch listed resource, properly associated.");
    28   } catch(ex) {
    29     window.opener.OfflineTest.ok(false, "Unable to fetch listed resource, not properly associated.");
    30   }
    32   window.opener.implicitLoaded(window, false);
    33 }
    35 function manifestError()
    36 {
    37   window.opener.implicitLoaded(window, true);
    38 }
    40 if (OfflineTest.setupChild()) {
    41   applicationCache.onerror = OfflineTest.priv(manifestError);
    42   applicationCache.onupdateready = OfflineTest.failEvent;
    43   applicationCache.oncached = OfflineTest.failEvent;
    44   applicationCache.onnoupdate = OfflineTest.priv(manifestUpdated);
    45 }
    47 </script>
    49 </head>
    51 <body>
    52 </body>
    53 </html>

mercurial