40 let ss =
Cc[
"@mozilla.org/browser/sessionstore;1"].getService(
Ci.nsISessionStore);
43 let uniqueName =
"bug 465215";
44 let uniqueValue1 =
"as good as unique: " + Date.now();
45 let uniqueValue2 =
"as good as unique: " + Math.random();
48 let
tab1 = gBrowser.addTab();
49 tab1.linkedBrowser.addEventListener(
"load",
function() {
50 tab1.linkedBrowser.removeEventListener(
"load",
arguments.callee,
true);
51 ss.setTabValue(tab1, uniqueName, uniqueValue1);
55 is(ss.getTabValue(tab2, uniqueName), uniqueValue1,
"tab value was duplicated");
57 ss.setTabValue(tab2, uniqueName, uniqueValue2);
58 isnot(ss.getTabValue(tab1, uniqueName), uniqueValue2,
"tab values aren't sync'd");
61 ss.setTabState(tab1,
JSON.stringify({ entries: [] }));
62 tab1.linkedBrowser.addEventListener(
"load",
function() {
63 tab1.linkedBrowser.removeEventListener(
"load",
arguments.callee,
true);
64 is(ss.getTabValue(tab1, uniqueName),
"",
"tab value was cleared");
67 gBrowser.removeTab(
tab2);
68 gBrowser.removeTab(tab1);
return!aWindow arguments!aWindow arguments[0]