Bug 1466388 - Android webext popup should not be considered to be the active or highlighted tab
MozReview-Commit-ID: 3WVoR80ICzo
--- a/mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_tabs_query.html
@@ -43,16 +43,18 @@ add_task(async function test_query_highl
"popup.html": `<script src="popup.js"><\/script>`,
"popup.js": async function popupScript() {
let active = await browser.tabs.query({active: true});
let highlighted = await browser.tabs.query({highlighted: true});
browser.test.assertEq(1, active.length, "should have one active tab");
browser.test.assertEq(1, highlighted.length, "should have one highlighted tab");
browser.test.assertEq(active[0].id, highlighted[0].id, "the active and highlighted tabs are the same one");
+ browser.test.assertEq(true, active[0].active, "the tab should be considered to be active");
+ browser.test.assertEq(true, active[0].highlighted, "the tab should be considered to be highlighted");
browser.test.sendMessage("tabs.query.popup");
},
},
});
const {BrowserApp} = Services.wm.getMostRecentWindow("navigator:browser");
let tabs = [];
--- a/toolkit/components/extensions/parent/ext-tabs-base.js
+++ b/toolkit/components/extensions/parent/ext-tabs-base.js
@@ -574,18 +574,18 @@ class TabBase {
* this tab hasn't been initialized yet.
* @returns {object}
*/
convert(fallbackTab = null) {
let result = {
id: this.id,
index: this.index,
windowId: this.windowId,
- highlighted: this.selected,
- active: this.selected,
+ highlighted: this.highlighted,
+ active: this.active,
pinned: this.pinned,
status: this.status,
hidden: this.hidden,
discarded: this.discarded,
incognito: this.incognito,
width: this.width,
height: this.height,
lastAccessed: this.lastAccessed,