xpcom/tests/unit/test_bug332389.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 Cc = Components.classes;
     2 var Ci = Components.interfaces;
     4 function run_test() {
     5   var f =
     6       Cc["@mozilla.org/file/directory_service;1"].
     7       getService(Ci.nsIProperties).get("CurProcD", Ci.nsIFile);
     9   var terminated = false;
    10   for (var i = 0; i < 100; i++) {
    11     if (f == null) {
    12       terminated = true;
    13       break;
    14     }
    15     f = f.parent;
    16   }
    18   do_check_true(terminated);
    19 }

mercurial