40 function test(aLambda) {
46 return ex.name ==
"NS_ERROR_ILLEGAL_VALUE";
50 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].getService(
Ci.nsISessionStore);
53 ok(
test(
function() ss.getWindowState({})),
54 "Invalid window for getWindowState throws");
55 ok(
test(
function() ss.setWindowState({},
"",
false)),
56 "Invalid window for setWindowState throws");
57 ok(
test(
function() ss.getTabState({})),
58 "Invalid tab for getTabState throws");
59 ok(
test(
function() ss.setTabState({},
"{}")),
60 "Invalid tab state for setTabState throws");
61 ok(
test(
function() ss.setTabState({},
"{ entries: [] }")),
62 "Invalid tab for setTabState throws");
63 ok(
test(
function() ss.duplicateTab({}, {})),
64 "Invalid tab for duplicateTab throws");
66 "Invalid window for duplicateTab throws");
67 ok(
test(
function() ss.getClosedTabData({})),
68 "Invalid window for getClosedTabData throws");
69 ok(
test(
function() ss.undoCloseTab({}, 0)),
70 "Invalid window for undoCloseTab throws");
71 ok(
test(
function() ss.undoCloseTab(
window, -1)),
72 "Invalid index for undoCloseTab throws");
73 ok(
test(
function() ss.getWindowValue({},
"")),
74 "Invalid window for getWindowValue throws");
75 ok(
test(
function() ss.getWindowValue({},
"")),
76 "Invalid window for getWindowValue throws");
77 ok(
test(
function() ss.getWindowValue({},
"",
"")),
78 "Invalid window for setWindowValue throws");
79 ok(
test(
function() ss.deleteWindowValue({},
"")),
80 "Invalid window for deleteWindowValue throws");
81 ok(
test(
function() ss.deleteWindowValue(
window, Date.now().toString())),
82 "Nonexistent value for deleteWindowValue throws");
83 ok(
test(
function() ss.deleteTabValue(
getBrowser().selectedTab, Date.now().toString())),
84 "Nonexistent value for deleteTabValue throws");
function getBrowser() gBrowser