Bug 1254814 - Synthesize the key to inspect the element in the right process; r=testonly
authorPatrick Brosset <pbrosset@mozilla.com>
Mon, 11 Jul 2016 15:19:46 +0200
changeset 304733 845645460806f28a8f249c5d3c60f07b46cef63c
parent 304732 016e4fdb5a52374d139e3553fc564a7ae0f9ea74
child 304734 98e51699f47e171256a8eb54605bed04a0be5e71
push id19983
push userpbrosset@mozilla.com
push dateWed, 13 Jul 2016 13:52:40 +0000
treeherderfx-team@845645460806 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);
   }, true);