docshell/test/unit_ipc/test_pb_notification_ipc.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 const Cc = Components.classes;
     2 const Ci = Components.interfaces;
     4 function run_test() {
     5   var notifications = 0;
     6   var obs = {
     7     observe: function(aSubject, aTopic, aData) {
     8       do_check_eq(aTopic, "last-pb-context-exited");
     9       notifications++;
    10     }
    11   };
    12   var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
    13   os.addObserver(obs, "last-pb-context-exited", false);
    15   run_test_in_child("../unit/test_pb_notification.js",
    16                     function() {
    17                       do_check_eq(notifications, 1);
    18                       do_test_finished();
    19                     });
    20 }

mercurial