michael@0: function test() { michael@0: function quitRequestObserver(aSubject, aTopic, aData) { michael@0: ok(aTopic == "quit-application-requested" && michael@0: aSubject instanceof Components.interfaces.nsISupportsPRBool, michael@0: "Received a quit request we're going to deny"); michael@0: aSubject.data = true; michael@0: } michael@0: michael@0: // ensure that we don't accidentally quit michael@0: Services.obs.addObserver(quitRequestObserver, "quit-application-requested", false); michael@0: michael@0: ok(!Application.quit(), "Tried to quit - and didn't succeed"); michael@0: ok(!Application.restart(), "Tried to restart - and didn't succeed"); michael@0: michael@0: // clean up michael@0: Services.obs.removeObserver(quitRequestObserver, "quit-application-requested"); michael@0: }