Bug 1287007 - Fix timing issue in browser/page action tests r=billm

MozReview-Commit-ID: 9L0ttaq42Ga

--HG--
extra : rebase_source : 0120e0bf68a5d60096454c6dd42b2496a73be3a5
This commit is contained in:
Rob Wu 2016-09-02 16:33:32 -07:00
Родитель e2e6ffa6f0
Коммит ef043e450c
2 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -184,11 +184,13 @@ add_task(function* testDetailsObjects() {
let detailString = JSON.stringify(details);
browser.test.log(`Setting browerAction/pageAction to ${detailString} expecting URLs ${JSON.stringify(details.resolutions)}`);
browser.browserAction.setIcon(Object.assign({tabId}, details.details));
browser.pageAction.setIcon(Object.assign({tabId}, details.details));
Promise.all([
browser.browserAction.setIcon(Object.assign({tabId}, details.details)),
browser.pageAction.setIcon(Object.assign({tabId}, details.details)),
]).then(() => {
browser.test.sendMessage("iconSet");
});
});
// Generate a list of tests and resolutions to send back to the test
// context.

Просмотреть файл

@ -6,7 +6,8 @@ let getExtension = () => {
return ExtensionTestUtils.loadExtension({
background() {
browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
browser.pageAction.show(tabs[0].id)
.then(() => { browser.test.sendMessage("pageAction ready"); });
});
},
@ -34,6 +35,7 @@ add_task(function* testStandaloneBrowserAction() {
let extension = getExtension();
yield extension.startup();
yield extension.awaitMessage("pageAction ready");
clickBrowserAction(extension);
let browser = yield awaitExtensionPanel(extension);
@ -47,6 +49,7 @@ add_task(function* testStandaloneBrowserAction() {
add_task(function* testMenuPanelBrowserAction() {
let extension = getExtension();
yield extension.startup();
yield extension.awaitMessage("pageAction ready");
let widget = getBrowserActionWidget(extension);
CustomizableUI.addWidgetToArea(widget.id, CustomizableUI.AREA_PANEL);
@ -63,6 +66,7 @@ add_task(function* testMenuPanelBrowserAction() {
add_task(function* testPageAction() {
let extension = getExtension();
yield extension.startup();
yield extension.awaitMessage("pageAction ready");
clickPageAction(extension);
let browser = yield awaitExtensionPanel(extension);