mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Review comments for bug 645428
This commit is contained in:
parent
810a4fb257
commit
1f41354148
@ -1,30 +1,21 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"]
|
||||
.getService(Ci.nsISessionStore);
|
||||
|
||||
let obs = Cc["@mozilla.org/observer-service;1"]
|
||||
.getService(Ci.nsIObserverService);
|
||||
|
||||
const NOTIFICATION = "sessionstore-browser-state-restored";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let observer = {
|
||||
observe: function (subject, topic, data) {
|
||||
if (NOTIFICATION == topic)
|
||||
finish();
|
||||
},
|
||||
function observe(subject, topic, data) {
|
||||
if (NOTIFICATION == topic) {
|
||||
finish();
|
||||
ok(true, "TOPIC received");
|
||||
}
|
||||
}
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
};
|
||||
|
||||
obs.addObserver(observer, NOTIFICATION, true);
|
||||
Services.obs.addObserver(observe, NOTIFICATION, false);
|
||||
registerCleanupFunction(function () {
|
||||
obs.removeObserver(observer, NOTIFICATION, true);
|
||||
Services.obs.removeObserver(observe, NOTIFICATION, false);
|
||||
});
|
||||
|
||||
ss.setBrowserState(JSON.stringify({ windows: [] }));
|
||||
|
Loading…
Reference in New Issue
Block a user