browser_ApplicationQuitting.js
Go to the documentation of this file.
1 function test() {
2  let quitRequestObserver = {
3  observe: function(aSubject, aTopic, aData) {
4  ok(aTopic == "quit-application-requested" &&
5  aSubject instanceof Components.interfaces.nsISupportsPRBool,
6  "Received a quit request we're going to deny");
7  aSubject.data = true;
8  }
9  };
10 
11  // ensure that we don't accidentally quit
12  let os = Components.classes["@mozilla.org/observer-service;1"]
13  .getService(Components.interfaces.nsIObserverService);
14  os.addObserver(quitRequestObserver, "quit-application-requested", false);
15 
16  ok(!Application.quit(), "Tried to quit - and didn't succeed");
17  ok(!Application.restart(), "Tried to restart - and didn't succeed");
18 
19  // clean up
20  os.removeObserver(quitRequestObserver, "quit-application-requested", false);
21 }
var Application
Definition: sbAboutDRM.js:37
var os
function test()
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe