Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | function test() { |
michael@0 | 6 | let tab1 = gBrowser.addTab("about:rights"); |
michael@0 | 7 | let tab2 = gBrowser.addTab("about:mozilla"); |
michael@0 | 8 | whenBrowserLoaded(tab1.linkedBrowser, mainPart); |
michael@0 | 9 | waitForExplicitFinish(); |
michael@0 | 10 | |
michael@0 | 11 | function mainPart() { |
michael@0 | 12 | // Tell the session storer that the tab is pinned |
michael@0 | 13 | let newTabState = '{"entries":[{"url":"about:rights"}],"pinned":true,"userTypedValue":"Hello World!"}'; |
michael@0 | 14 | ss.setTabState(tab1, newTabState); |
michael@0 | 15 | |
michael@0 | 16 | // Undo pinning |
michael@0 | 17 | gBrowser.unpinTab(tab1); |
michael@0 | 18 | |
michael@0 | 19 | // Close and restore tab |
michael@0 | 20 | gBrowser.removeTab(tab1); |
michael@0 | 21 | let savedState = JSON.parse(ss.getClosedTabData(window))[0].state; |
michael@0 | 22 | isnot(savedState.pinned, true, "Pinned should not be true"); |
michael@0 | 23 | tab1 = ss.undoCloseTab(window, 0); |
michael@0 | 24 | |
michael@0 | 25 | isnot(tab1.pinned, true, "Should not be pinned"); |
michael@0 | 26 | gBrowser.removeTab(tab1); |
michael@0 | 27 | gBrowser.removeTab(tab2); |
michael@0 | 28 | finish(); |
michael@0 | 29 | } |
michael@0 | 30 | } |