gecko-dev/browser/fuel/test/browser_ApplicationQuitting.js

18 lines
648 B
JavaScript
Raw Normal View History

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