|
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 } |
|
8 |
|
9 // ensure that we don't accidentally quit |
|
10 Services.obs.addObserver(quitRequestObserver, "quit-application-requested", false); |
|
11 |
|
12 ok(!Application.quit(), "Tried to quit - and didn't succeed"); |
|
13 ok(!Application.restart(), "Tried to restart - and didn't succeed"); |
|
14 |
|
15 // clean up |
|
16 Services.obs.removeObserver(quitRequestObserver, "quit-application-requested"); |
|
17 } |