browser_579868.js (1064B)
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/. */ 4 5 function test() { 6 waitForExplicitFinish(); 7 8 let tab1 = BrowserTestUtils.addTab(gBrowser, "about:robots"); 9 let tab2 = BrowserTestUtils.addTab(gBrowser, "about:mozilla"); 10 11 promiseBrowserLoaded(tab1.linkedBrowser).then(() => { 12 // Tell the session storer that the tab is pinned 13 let newTabState = 14 '{"entries":[{"url":"about:robots"}],"pinned":true,"userTypedValue":"Hello World!"}'; 15 ss.setTabState(tab1, newTabState); 16 17 // Undo pinning 18 gBrowser.unpinTab(tab1); 19 20 // Close and restore tab 21 gBrowser.removeTab(tab1); 22 let savedState = ss.getClosedTabDataForWindow(window)[0].state; 23 isnot(savedState.pinned, true, "Pinned should not be true"); 24 tab1 = ss.undoCloseTab(window, 0); 25 26 isnot(tab1.pinned, true, "Should not be pinned"); 27 gBrowser.removeTab(tab1); 28 gBrowser.removeTab(tab2); 29 finish(); 30 }); 31 }