Bug 1246035: Add support for _execute_page_action r=kmag
MozReview-Commit-ID: 5Lvj5UiAVkJ
--- a/browser/components/extensions/test/browser/browser_ext_commands_execute_page_action.js
+++ b/browser/components/extensions/test/browser/browser_ext_commands_execute_page_action.js
@@ -43,23 +43,22 @@ add_task(function* test_execute_page_act
browser.test.assertTrue(isShown, "The onClicked event should fire if the page action is shown.");
browser.test.notifyPass("page-action-without-popup");
});
browser.test.sendMessage("send-keys");
},
});
- yield extension.startup();
-
extension.onMessage("send-keys", () => {
EventUtils.synthesizeKey("j", {altKey: true, shiftKey: true});
EventUtils.synthesizeKey("3", {altKey: true, shiftKey: true});
});
+ yield extension.startup();
yield extension.awaitFinish("page-action-without-popup");
yield extension.unload();
});
add_task(function* test_execute_page_action_with_popup() {
let scriptPage = url => `<html><head><meta charset="utf-8"><script src="${url}"></script></head><body>Test Popup</body></html>`;
let extension = ExtensionTestUtils.loadExtension({
@@ -118,18 +117,17 @@ add_task(function* test_execute_page_act
browser.test.assertTrue(isShown, "The onClicked event should fire if the page action is shown.");
browser.test.notifyPass("page-action-with-popup");
});
browser.test.sendMessage("send-keys");
},
});
- yield extension.startup();
-
extension.onMessage("send-keys", () => {
EventUtils.synthesizeKey("j", {altKey: true, shiftKey: true});
EventUtils.synthesizeKey("3", {altKey: true, shiftKey: true});
});
+ yield extension.startup();
yield extension.awaitFinish("page-action-with-popup");
yield extension.unload();
});