test: Added smoke test for pageAction.show fallback to no callback on chrome.

This commit is contained in:
Luca Greco 2018-03-13 14:16:09 +01:00
parent 596f47bcc8
commit 0fd508671a
2 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,12 @@ console.log(name, "background page loaded");
browser.runtime.onMessage.addListener((msg, sender) => { browser.runtime.onMessage.addListener((msg, sender) => {
console.log(name, "background received msg", {msg, sender}); console.log(name, "background received msg", {msg, sender});
try {
browser.pageAction.show(sender.tab.id);
} catch (err) {
return Promise.resolve(`Unexpected error on pageAction.show: ${err}`);
}
return Promise.resolve("background page reply"); return Promise.resolve("background page reply");
}); });

View File

@ -20,5 +20,8 @@
"browser-polyfill.js", "browser-polyfill.js",
"background.js" "background.js"
] ]
},
"page_action": {
"default_title": "a page action"
} }
} }