Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 function test() {
6 /** Test for Bug 465215 **/
8 waitForExplicitFinish();
10 let uniqueName = "bug 465215";
11 let uniqueValue1 = "as good as unique: " + Date.now();
12 let uniqueValue2 = "as good as unique: " + Math.random();
14 // set a unique value on a new, blank tab
15 let tab1 = gBrowser.addTab();
16 whenBrowserLoaded(tab1.linkedBrowser, function() {
17 ss.setTabValue(tab1, uniqueName, uniqueValue1);
19 // duplicate the tab with that value
20 let tab2 = ss.duplicateTab(window, tab1);
21 is(ss.getTabValue(tab2, uniqueName), uniqueValue1, "tab value was duplicated");
23 ss.setTabValue(tab2, uniqueName, uniqueValue2);
24 isnot(ss.getTabValue(tab1, uniqueName), uniqueValue2, "tab values aren't sync'd");
26 // overwrite the tab with the value which should remove it
27 ss.setTabState(tab1, JSON.stringify({ entries: [] }));
28 whenTabRestored(tab1, function() {
29 is(ss.getTabValue(tab1, uniqueName), "", "tab value was cleared");
31 // clean up
32 gBrowser.removeTab(tab2);
33 gBrowser.removeTab(tab1);
34 finish();
35 });
36 });
37 }