Bug 1431961 - Wait for the extension startup code before starting tests in browser/components/extensions/test/browser/browser_ext_user_events.js r=kmag

This commit is contained in:
Tooru Fujisawa 2018-01-21 14:29:42 +09:00
parent 1772747906
commit f3708770fd

View File

@ -18,7 +18,6 @@ add_task(async function testSources() {
let tabs = await browser.tabs.query({active: true, currentWindow: true});
await browser.pageAction.show(tabs[0].id);
browser.test.sendMessage("page-action-shown");
browser.pageAction.onClicked.addListener(request);
browser.browserAction.onClicked.addListener(request);
@ -29,6 +28,8 @@ add_task(async function testSources() {
contexts: ["page"],
});
browser.contextMenus.onClicked.addListener(request);
browser.test.sendMessage("actions-ready");
},
manifest: {
@ -49,8 +50,8 @@ add_task(async function testSources() {
CustomizableUI.removeWidgetFromArea("sidebar-button");
await extension.startup();
await extension.awaitMessage("actions-ready");
await extension.awaitMessage("page-action-shown");
clickPageAction(extension);
await check("page action click");