From 0fd508671aad4b9530b22f612871bdb58c363c40 Mon Sep 17 00:00:00 2001 From: Luca Greco Date: Tue, 13 Mar 2018 14:16:09 +0100 Subject: [PATCH] test: Added smoke test for pageAction.show fallback to no callback on chrome. --- test/fixtures/runtime-messaging-extension/background.js | 6 ++++++ test/fixtures/runtime-messaging-extension/manifest.json | 3 +++ 2 files changed, 9 insertions(+) diff --git a/test/fixtures/runtime-messaging-extension/background.js b/test/fixtures/runtime-messaging-extension/background.js index db8d4d2..f6bb3da 100644 --- a/test/fixtures/runtime-messaging-extension/background.js +++ b/test/fixtures/runtime-messaging-extension/background.js @@ -5,6 +5,12 @@ console.log(name, "background page loaded"); browser.runtime.onMessage.addListener((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"); }); diff --git a/test/fixtures/runtime-messaging-extension/manifest.json b/test/fixtures/runtime-messaging-extension/manifest.json index 084a423..e4d5aea 100644 --- a/test/fixtures/runtime-messaging-extension/manifest.json +++ b/test/fixtures/runtime-messaging-extension/manifest.json @@ -20,5 +20,8 @@ "browser-polyfill.js", "background.js" ] + }, + "page_action": { + "default_title": "a page action" } }