Bug 1351148 Part6: Revise browser_toolbox_races.js to avoid jam content process by synthesized input events. f=jryans,pbro. r=ochameau.
authorStone Shih <sshih@mozilla.com>
Mon, 05 Jun 2017 13:00:44 +0800
changeset 418895 7adefc652d954eaa83cb4e2a871cf2a153f3f9ea
parent 418894 4e29b5422902f18d9dbe37473878ea65893f1cc4
child 418896 fcdaffc1de9fcc71d37c60f807be7d2885bb6fc6
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1351148
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1351148 Part6: Revise browser_toolbox_races.js to avoid jam content process by synthesized input events. f=jryans,pbro. r=ochameau. When the event prioritization is enabled, we'll reserve some time to process input events in each frame. In that case the synthesized input events delay the execution of normal events a lot and cause the test timeout. MozReview-Commit-ID: 1G3ggeaZ1Os
devtools/client/framework/test/browser_toolbox_races.js
--- a/devtools/client/framework/test/browser_toolbox_races.js
+++ b/devtools/client/framework/test/browser_toolbox_races.js
@@ -6,16 +6,17 @@
 "use strict";
 
 // Toggling the toolbox three time can take more than 45s on slow test machine
 requestLongerTimeout(2);
 
 // Test toggling the toolbox quickly and see if there is any race breaking it.
 
 const URL = "data:text/html;charset=utf-8,Toggling devtools quickly";
+const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
 
 add_task(function* () {
   // Make sure this test starts with the selectedTool pref cleared. Previous
   // tests select various tools, and that sets this pref.
   Services.prefs.clearUserPref("devtools.toolbox.selectedTool");
 
   let tab = yield addTab(URL);
 
@@ -75,10 +76,15 @@ add_task(function* () {
   gDevTools.off("toolbox-ready", onReady);
   gDevTools.off("toolbox-destroy", onDestroy);
   gDevTools.off("toolbox-destroyed", onDestroyed);
 
   gBrowser.removeCurrentTab();
 });
 
 function toggle() {
-  EventUtils.synthesizeKey("VK_F12", {});
+  // When enabling the input event prioritization, we'll reserve some time to
+  // process input events in each frame. In that case, the synthesized input
+  // events may delay the normal events. Replace synthesized key events by
+  // toggleToolboxCommand to prevent the synthesized input events jam the
+  // content process and cause the test timeout.
+  gDevToolsBrowser.toggleToolboxCommand(window.gBrowser);
 }