40 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].getService(
Ci.nsISessionStore);
43 let newWin = openDialog(location,
"_blank",
"chrome,all,dialog=no,toolbar=yes");
44 newWin.addEventListener(
"load",
function() {
45 newWin.removeEventListener(
"load",
arguments.callee,
false);
47 executeSoon(
function() {
48 let state1 = ss.getWindowState(newWin);
51 newWin = openDialog(location,
"_blank",
52 "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar=no,location,personal,directories,dialog=no");
53 newWin.addEventListener(
"load",
function() {
54 newWin.removeEventListener(
"load",
arguments.callee,
false);
56 executeSoon(
function() {
57 let state2 = ss.getWindowState(newWin);
61 let
win = openDialog(location,
"_blank",
"chrome,all,dialog=no");
62 win.addEventListener(
"load",
function() {
63 win.removeEventListener(
"load",
arguments.callee,
false);
65 is(win.gURLBar.readOnly,
false,
66 "URL bar should not be read-only before setting the state");
67 is(win.gURLBar.getAttribute(
"enablehistory"),
"true",
68 "URL bar autocomplete should be enabled before setting the state");
69 ss.setWindowState(win, state,
true);
70 is(win.gURLBar.readOnly,
expected.readOnly,
71 "URL bar read-only state should be restored correctly");
72 is(win.gURLBar.getAttribute(
"enablehistory"),
expected.enablehistory,
73 "URL bar autocomplete state should be restored correctly");
80 testState(state1, {readOnly:
false, enablehistory:
"true"},
function() {
81 testState(state2, {readOnly:
true, enablehistory:
"false"},
function() {
return!aWindow arguments!aWindow arguments[0]