44 let cs =
Cc[
"@mozilla.org/cookiemanager;1"].getService(
Ci.nsICookieManager2);
47 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].getService(
Ci.nsISessionStore);
51 gPrefService.setIntPref(
"browser.sessionstore.interval", 0);
53 const testURL =
"http://localhost:8888/browser/" +
54 "browser/components/sessionstore/test/browser/browser_423132_sample.html";
57 let newWin = openDialog(location,
"_blank",
"chrome,all,dialog=no",
"about:blank");
60 newWin.addEventListener(
"load",
function (aEvent) {
61 newWin.removeEventListener(
"load",
arguments.callee,
false);
65 newWin.gBrowser.addEventListener(
"load",
function (aEvent) {
66 newWin.gBrowser.removeEventListener(
"load",
arguments.callee,
true);
69 let state = ss.getWindowState(newWin);
72 let e = cs.enumerator;
75 while (e.hasMoreElements()) {
76 cookie = e.getNext().QueryInterface(
Ci.nsICookie);
79 is(i, 1,
"expected one cookie");
85 ss.setWindowState(newWin, state,
true);
90 while (e.hasMoreElements()) {
91 cookie2 = e.getNext().QueryInterface(
Ci.nsICookie);
92 if (cookie.name == cookie2.name)
95 is(cookie.name, cookie2.name,
"cookie name successfully restored");
96 is(cookie.value, cookie2.value,
"cookie value successfully restored");
97 is(cookie.path, cookie2.path,
"cookie path successfully restored");
100 if (
gPrefService.prefHasUserValue(
"browser.sessionstore.interval"))
101 gPrefService.clearUserPref(
"browser.sessionstore.interval");
return!aWindow arguments!aWindow arguments[0]
_getSelectedPageStyle s i