michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: let tab1 = gBrowser.addTab("about:rights"); michael@0: let tab2 = gBrowser.addTab("about:mozilla"); michael@0: whenBrowserLoaded(tab1.linkedBrowser, mainPart); michael@0: waitForExplicitFinish(); michael@0: michael@0: function mainPart() { michael@0: // Tell the session storer that the tab is pinned michael@0: let newTabState = '{"entries":[{"url":"about:rights"}],"pinned":true,"userTypedValue":"Hello World!"}'; michael@0: ss.setTabState(tab1, newTabState); michael@0: michael@0: // Undo pinning michael@0: gBrowser.unpinTab(tab1); michael@0: michael@0: // Close and restore tab michael@0: gBrowser.removeTab(tab1); michael@0: let savedState = JSON.parse(ss.getClosedTabData(window))[0].state; michael@0: isnot(savedState.pinned, true, "Pinned should not be true"); michael@0: tab1 = ss.undoCloseTab(window, 0); michael@0: michael@0: isnot(tab1.pinned, true, "Should not be pinned"); michael@0: gBrowser.removeTab(tab1); michael@0: gBrowser.removeTab(tab2); michael@0: finish(); michael@0: } michael@0: }