dom/tests/mochitest/ajax/lib/AJAX_setup.js

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 var AJAXtests = [];
     3 function runAJAXTest() {
     4   if (AJAXtests.length == 0) {
     5     SimpleTest.finish();
     6     return;
     7   }
     9   var test = AJAXtests.shift();
    10   var testframe = document.getElementById("testframe");
    11   testframe.src = test;
    12 }
    14 function onManifestLoad(manifest) {
    15   if (manifest.testcases) {
    16     AJAXtests = manifest.testcases;
    17     runAJAXTest();    
    18   } else {
    19     ok(false, "manifest check", "no manifest!?!");
    20     SimpleTest.finish();
    21   }
    22 }
    24 function fetchManifest() {
    25   var d = loadJSONDoc("manifest.json");
    26   d.addBoth(onManifestLoad);
    27 }
    29 SimpleTest.waitForExplicitFinish();
    30 addLoadEvent(fetchManifest);

mercurial