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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest">
     2 <head>
     3 <title>wildcard in network section test</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 <style>
    10   img {
    11     max-width: 400px;
    12     max-height: 400px;
    13   }
    14 </style>
    16 <script type="text/javascript">
    18 var gImageLoaded = [];
    20 function imageOnLoad(idx)
    21 {
    22   gImageLoaded[idx] = true;
    23 }
    25 function manifestUpdated()
    26 {
    27   window.location.reload();
    28 }
    30 function finishTheTest()
    31 {
    32   OfflineTest.is(gImageLoaded[1], true, "Image from a different origin not cointained in the offline cache has loaded");
    33   OfflineTest.is(gImageLoaded[2], true, "Image not cointained in the offline cache has loaded");
    34   OfflineTest.teardownAndFinish();
    35 }
    37 if (OfflineTest.setup()) {
    38   applicationCache.onerror = OfflineTest.failEvent;
    39   applicationCache.oncached = OfflineTest.priv(manifestUpdated);
    40   applicationCache.onnoupdate = OfflineTest.priv(finishTheTest);
    41 }
    43 SimpleTest.waitForExplicitFinish();
    45 </script>
    47 </head>
    49 <body>
    50   <img src="http://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" />
    51   <img src="jupiter.jpg" onload="imageOnLoad(2)" />
    52 </body>
    53 </html>

mercurial