2008-09-06 21:30:13 -07:00
|
|
|
function test() {
|
2010-02-06 00:47:42 -08:00
|
|
|
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 00:20:42 -07:00
|
|
|
|
2008-09-06 21:30:13 -07:00
|
|
|
// ensure that we don't accidentally quit
|
2010-04-02 00:20:42 -07:00
|
|
|
Services.obs.addObserver(quitRequestObserver, "quit-application-requested", false);
|
|
|
|
|
2008-09-06 21:30:13 -07:00
|
|
|
ok(!Application.quit(), "Tried to quit - and didn't succeed");
|
|
|
|
ok(!Application.restart(), "Tried to restart - and didn't succeed");
|
2010-04-02 00:20:42 -07:00
|
|
|
|
2008-09-06 21:30:13 -07:00
|
|
|
// clean up
|
2010-04-02 00:20:42 -07:00
|
|
|
Services.obs.removeObserver(quitRequestObserver, "quit-application-requested", false);
|
2008-09-06 21:30:13 -07:00
|
|
|
}
|