Bug 1337509 - Do not create tab objects with an unsupported 'selected' property. r=bsilverberg,mixedpuppy

MozReview-Commit-ID: 4Bi6LdNUxMo

--HG--
extra : rebase_source : 52baba39e08bc9d250ace3f4b46a591d7f641d47
This commit is contained in:
Tushar Saini (:shatur) 2017-04-18 22:07:38 +05:30
Родитель e52aba5a9b
Коммит 163e27b705
6 изменённых файлов: 9 добавлений и 5 удалений

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

@ -557,7 +557,6 @@ class Tab extends TabBase {
sessionId: String(tabData.closedId),
index: tabData.pos ? tabData.pos : 0,
windowId: window && windowTracker.getId(window),
selected: false,
highlighted: false,
active: false,
pinned: false,

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

@ -8,6 +8,9 @@ function expectedTabInfo(tab, window) {
url: browser.currentURI.spec,
title: browser.contentTitle,
favIconUrl: window.gBrowser.getIcon(tab),
// 'selected' is marked as unsupported in schema, so we've removed it.
// For more details, see bug 1337509
selected: undefined,
};
}

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

@ -41,6 +41,9 @@ add_task(function* test_create_options() {
active: true,
pinned: false,
url: "about:newtab",
// 'selected' is marked as unsupported in schema, so we've removed it.
// For more details, see bug 1337509
selected: undefined,
};
let tests = [

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

@ -22,8 +22,8 @@ add_task(function* testDuplicateTab() {
browser.test.assertEq("http://example.net/", tab.url);
// Should be the second tab, next to the one duplicated.
browser.test.assertEq(1, tab.index);
// Should be selected by default.
browser.test.assertTrue(tab.selected);
// Should be active by default.
browser.test.assertTrue(tab.active);
browser.test.notifyPass("tabs.duplicate");
});
});

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

@ -24,7 +24,7 @@ function checkWindow(window) {
}
function checkTab(tab, windowId, incognito) {
for (let prop of ["selected", "highlighted", "active", "pinned"]) {
for (let prop of ["highlighted", "active", "pinned"]) {
is(tab[prop], false, `closed tab has the expected value for ${prop}`);
}
is(tab.windowId, windowId, "closed tab has the expected value for windowId");

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

@ -461,7 +461,6 @@ class TabBase {
id: this.id,
index: this.index,
windowId: this.windowId,
selected: this.selected,
highlighted: this.selected,
active: this.selected,
pinned: this.pinned,