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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <html>
     2 <head>
     3 <title>Test obsolete application caches</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 var gTestWin;
    12 SpecialPowers.pushPermissions([{'type': 'offline-app', 'allow': true, 'context': document}], startTest);
    14 function startTest() {
    15   // Make the obsoleting.sjs return a valid manifest
    16   var req = new XMLHttpRequest();
    17   req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
    18   req.setRequestHeader("Content-Type", "text/cache-manifest");
    19   req.send("");
    20   req.onreadystatechange = function() {
    21     if (req.readyState == 4) {
    22       // now this will properly load the manifest.
    23       gTestWin = window.open("obsolete.html");
    24     }
    25   }
    26 }
    28 function finish() {
    29   gTestWin.close();
    30   SimpleTest.finish();
    31 }
    33 SimpleTest.waitForExplicitFinish();
    35 </script>
    37 </head>
    39 <body>
    41 </body>
    42 </html>

mercurial