Review comments for bug 645428

This commit is contained in:
Paul O’Shannessy 2011-08-15 18:20:15 -07:00
parent 810a4fb257
commit 1f41354148

View File

@ -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: [] }));