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

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 <html manifest="445544.cacheManifest">
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=445544
     4 -->
     6 <head>
     7 <title>Test for Bug 445544</title>
     9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    11 <script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
    13 <script type="text/javascript">
    15 var gTestWin;
    16 var gTimeoutId;
    18 function finish()
    19 {
    20   gTestWin.close();
    21   OfflineTest.teardownAndFinish();
    22 }
    24 function error()
    25 {
    26   OfflineTest.ok(false, "Part 2 did not successfully load.");
    27   finish();
    28 }
    30 function part2loaded()
    31 {
    32   clearTimeout(gTimeoutId);
    33   OfflineTest.ok(true, "Part 2 successfully loaded.");
    34   finish();
    35 }
    37 function part1loaded(appCacheStatus)
    38 {
    39   OfflineTest.ok(appCacheStatus > 0,
    40                  "Part 1 successfully loaded from the application cache.");
    42   // Loading part 2 (which is not part of that application
    43   // cache) should succeed...
    44   gTestWin.location = "445544_part2.html";
    46   // We won't be notified if the page fails to load, fail this test
    47   // in 10 seconds.
    48   gTimeoutId = setTimeout(error, 10000);
    49 }
    51 function manifestUpdated()
    52 {
    53   // Open a new window that will be associated with this application
    54   // cache.  This will call part1loaded().
    55   gTestWin = window.open("445544_part1.html");
    56 }
    58 if (OfflineTest.setup()) {
    59   applicationCache.onerror = OfflineTest.failEvent;
    60   applicationCache.oncached = OfflineTest.priv(manifestUpdated);
    61 }
    63 SimpleTest.waitForExplicitFinish();
    65 </script>
    67 </head>
    69 <body>
    71 </body>
    72 </html>

mercurial