docshell/test/unit/test_pb_notification.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 if (typeof Cc === "undefined")
     2   Cc = Components.classes;
     3 if (typeof Ci === "undefined")
     4   Ci = Components.interfaces;
     6 function destroy_transient_docshell() {
     7   var docshell = Cc["@mozilla.org/docshell;1"].createInstance(Ci.nsIDocShell);
     8   docshell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing = true;
     9   do_test_pending();
    10   do_timeout(0, Components.utils.forceGC);
    11 }
    13 function run_test() {
    14   var obs = {
    15     observe: function(aSubject, aTopic, aData) {
    16       do_check_eq(aTopic, "last-pb-context-exited");
    17       do_test_finished();
    18     }
    19   };
    20   var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
    21   os.addObserver(obs, "last-pb-context-exited", false);
    22   destroy_transient_docshell();
    23 }

mercurial