Bug 1254814 - Synthesize the key to inspect the element in the right process; r=testonly
In browser_markup_load_01.js, the browser context menu is opened and then the
Q key is pressed in order to choose the "inspect" menu item.
However this key is simulated in the content process, using the testActor.
Since the menu itself lives in the parent process, the key event should instead
be simulated in the parent process for it to work properly.
I suspect that this was sometimes causing the menu to stay open in subsequent
tests.
MozReview-Commit-ID: 1cOF7CSk7sm
--- a/devtools/client/inspector/markup/test/browser_markup_load_01.js
+++ b/devtools/client/inspector/markup/test/browser_markup_load_01.js
@@ -53,17 +53,17 @@ add_task(function* () {
});
function* chooseWithInspectElementContextMenu(selector, testActor) {
yield BrowserTestUtils.synthesizeMouseAtCenter(selector, {
type: "contextmenu",
button: 2
}, gBrowser.selectedBrowser);
- yield testActor.synthesizeKey({key: "Q", options: {}});
+ yield EventUtils.synthesizeKey("Q", {});
}
function waitForLinkedBrowserEvent(tab, event) {
let def = defer();
tab.linkedBrowser.addEventListener(event, function cb() {
tab.linkedBrowser.removeEventListener(event, cb, true);
def.resolve();
}, true);