2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-10-23 04:13:37 +04:00
|
|
|
|
|
|
|
function test() {
|
2015-01-29 11:41:57 +03:00
|
|
|
waitForExplicitFinish();
|
|
|
|
|
2012-02-23 05:18:13 +04:00
|
|
|
let tab1 = gBrowser.addTab("about:rights");
|
2011-01-27 00:38:00 +03:00
|
|
|
let tab2 = gBrowser.addTab("about:mozilla");
|
2010-11-13 00:48:19 +03:00
|
|
|
|
2015-01-29 11:41:57 +03:00
|
|
|
promiseBrowserLoaded(tab1.linkedBrowser).then(() => {
|
2010-10-23 04:13:37 +04:00
|
|
|
// Tell the session storer that the tab is pinned
|
2012-02-23 05:18:13 +04:00
|
|
|
let newTabState = '{"entries":[{"url":"about:rights"}],"pinned":true,"userTypedValue":"Hello World!"}';
|
2010-10-23 04:13:37 +04:00
|
|
|
ss.setTabState(tab1, newTabState);
|
|
|
|
|
2010-11-13 00:48:19 +03:00
|
|
|
// Undo pinning
|
2010-10-23 04:13:37 +04:00
|
|
|
gBrowser.unpinTab(tab1);
|
2013-05-24 17:28:29 +04:00
|
|
|
|
2010-10-23 04:13:37 +04:00
|
|
|
// Close and restore tab
|
|
|
|
gBrowser.removeTab(tab1);
|
|
|
|
let savedState = JSON.parse(ss.getClosedTabData(window))[0].state;
|
|
|
|
isnot(savedState.pinned, true, "Pinned should not be true");
|
|
|
|
tab1 = ss.undoCloseTab(window, 0);
|
|
|
|
|
|
|
|
isnot(tab1.pinned, true, "Should not be pinned");
|
|
|
|
gBrowser.removeTab(tab1);
|
|
|
|
gBrowser.removeTab(tab2);
|
|
|
|
finish();
|
2015-01-29 11:41:57 +03:00
|
|
|
});
|
2010-10-23 04:13:37 +04:00
|
|
|
}
|