mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 1392322 - Fix browserAction.setTitle for currently active tab on Android. r=mixedpuppy
MozReview-Commit-ID: 1Wka0zFxElD --HG-- extra : rebase_source : 0537c9ab120f78e72b3e182f61504edd7d4ca5ee
This commit is contained in:
parent
692daa6f92
commit
1bb1390f49
@ -84,7 +84,7 @@ class BrowserAction {
|
||||
}
|
||||
}
|
||||
|
||||
if (!tab || tab.selected) {
|
||||
if (!tab || tab.getActive()) {
|
||||
BrowserActions.update(this.uuid, {[prop]: value});
|
||||
}
|
||||
}
|
||||
|
@ -140,6 +140,37 @@ add_task(async function test_setTitle_and_getTitle() {
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
|
||||
add_task(async function test_setTitle_activeTab() {
|
||||
async function background() {
|
||||
const tabs = await browser.tabs.query({active: true});
|
||||
const tabId = tabs[0].id;
|
||||
|
||||
const title = "Customized browserAction title";
|
||||
await browser.browserAction.setTitle({tabId, title});
|
||||
|
||||
browser.test.notifyPass("browserAction_setTitle_activeTab.done");
|
||||
}
|
||||
|
||||
const extension = ExtensionTestUtils.loadExtension({
|
||||
background,
|
||||
manifest: {
|
||||
"browser_action": {
|
||||
"default_title": "Browser Action default title",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await extension.startup();
|
||||
|
||||
await extension.awaitFinish("browserAction_setTitle_activeTab.done");
|
||||
|
||||
is(BrowserActions.getNameForActiveTab(`{${extension.uuid}}`),
|
||||
"Customized browserAction title",
|
||||
"The browserAction title has been updated on the currently activeTab");
|
||||
|
||||
await extension.unload();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user