Bug 606936 - userTypedValue sticks around after session restore (favicon and star button missing) [r=dietrich, a=blocking2.0:final+]

This commit is contained in:
Paul O’Shannessy 2010-11-12 13:48:19 -08:00
Родитель c3050419e9
Коммит b765e6180c
2 изменённых файлов: 3 добавлений и 14 удалений

Просмотреть файл

@ -1459,13 +1459,6 @@ SessionStoreService.prototype = {
tabData.pinned = true;
else
delete tabData.pinned;
if (browser.userTypedValue) {
tabData.userTypedValue = browser.userTypedValue;
tabData.userTypedClear = browser.userTypedClear;
} else {
delete tabData.userTypedValue;
delete tabData.userTypedClear;
}
return tabData;
}

Просмотреть файл

@ -39,28 +39,24 @@ function test() {
let tab2 = gBrowser.addTab("about:credits");
tab1.addEventListener("load", mainPart, true);
waitForExplicitFinish();
function mainPart() {
// Tell the session storer that the tab is pinned
// and that userTypedValue is "Hello World!"
let newTabState = '{"entries":[{"url":"about:robots"}],"pinned":true,"userTypedValue":"Hello World!"}';
let ss = Cc["@mozilla.org/browser/sessionstore;1"]
.getService(Ci.nsISessionStore);
ss.setTabState(tab1, newTabState);
// Undo pinning and userTypedValue
// Undo pinning
gBrowser.unpinTab(tab1);
tab1.linkedBrowser.userTypedValue = null;
is(tab1.linkedBrowser.__SS_data._tabStillLoading, true,
"_tabStillLoading should be true.");
// 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");
isnot(savedState.userTypedValue, "Hello World!",
"userTypedValue should not be Hello World!");
tab1 = ss.undoCloseTab(window, 0);
isnot(tab1.pinned, true, "Should not be pinned");