mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
19 lines
725 B
JavaScript
19 lines
725 B
JavaScript
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;
|
|
}
|
|
|
|
// ensure that we don't accidentally quit
|
|
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
|
os.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");
|
|
|
|
// clean up
|
|
os.removeObserver(quitRequestObserver, "quit-application-requested", false);
|
|
}
|