browser/fuel/test/browser_ApplicationQuitting.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 function test() {
     2   function quitRequestObserver(aSubject, aTopic, aData) {
     3     ok(aTopic == "quit-application-requested" &&
     4        aSubject instanceof Components.interfaces.nsISupportsPRBool,
     5        "Received a quit request we're going to deny");
     6     aSubject.data = true;
     7   }
     9   // ensure that we don't accidentally quit
    10   Services.obs.addObserver(quitRequestObserver, "quit-application-requested", false);
    12   ok(!Application.quit(),    "Tried to quit - and didn't succeed");
    13   ok(!Application.restart(), "Tried to restart - and didn't succeed");
    15   // clean up
    16   Services.obs.removeObserver(quitRequestObserver, "quit-application-requested");
    17 }

mercurial