Bug 1773977 - Add missing implementation for WindowBase.getHighlightedTabs(). r=mkmelin.
Differential Revision: https://phabricator.services.mozilla.com/D151724
This commit is contained in:
Родитель
f93f200beb
Коммит
88b67306fb
|
@ -1314,6 +1314,16 @@ class Window extends WindowBase {
|
|||
yield tabManager.getWrapper(this.window);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator of TabBase objects for the highlighted tab in this
|
||||
* window. This is an alias for the active tab.
|
||||
*
|
||||
* @returns {Iterator<TabBase>}
|
||||
*/
|
||||
*getHighlightedTabs() {
|
||||
yield this.activeTab;
|
||||
}
|
||||
|
||||
/** Retrieves the active tab in this window */
|
||||
get activeTab() {
|
||||
let { tabManager } = this.extension;
|
||||
|
|
|
@ -59,6 +59,24 @@ add_task(async function testQuery() {
|
|||
"Id of mail tab is correct"
|
||||
);
|
||||
|
||||
// Query for active tab.
|
||||
tabs = await browser.tabs.query({ active: true });
|
||||
browser.test.assertEq(1, tabs.length, "Found one mail tab");
|
||||
browser.test.assertEq(
|
||||
contentTab.id,
|
||||
tabs[0].id,
|
||||
"Id of mail tab is correct"
|
||||
);
|
||||
|
||||
// Query for highlighted tab.
|
||||
tabs = await browser.tabs.query({ highlighted: true });
|
||||
browser.test.assertEq(1, tabs.length, "Found one mail tab");
|
||||
browser.test.assertEq(
|
||||
contentTab.id,
|
||||
tabs[0].id,
|
||||
"Id of mail tab is correct"
|
||||
);
|
||||
|
||||
await browser.tabs.remove(contentTab.id);
|
||||
browser.test.notifyPass();
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче