Bug 1518005 - Fix intermittent devotools test. r=bgrins
authorBrendan Dahl <bdahl@mozilla.com>
Thu, 11 Apr 2019 21:08:04 +0000
changeset 469120 6922b4c2b5c57ca3ac2d20d1062312d335a0845e
parent 469119 47660e04a4f9e098ddf459d05c99b3e68d351e13
child 469121 236d2bc601b0604b30e03b2e61a50a3886961edb
push id35856
push usercsabou@mozilla.com
push dateFri, 12 Apr 2019 03:19:48 +0000
treeherdermozilla-central@940684cd1065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1518005
milestone68.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 1518005 - Fix intermittent devotools test. r=bgrins Wait for devtools panel to be ready before attempting to use it. Differential Revision: https://phabricator.services.mozilla.com/D27160
devtools/client/inspector/test/browser_inspector_highlighter-07.js
--- a/devtools/client/inspector/test/browser_inspector_highlighter-07.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-07.js
@@ -24,18 +24,18 @@ function waitForPaused(dbg) {
       if (debuggerIsPaused(dbg)) {
         unsubscribe();
         resolve();
       }
     });
   });
 }
 
-function createDebuggerContext(toolbox) {
-  const panel = toolbox.getPanel("jsdebugger");
+async function createDebuggerContext(toolbox) {
+  const panel = await toolbox.getPanelWhenReady("jsdebugger");
   const win = panel.panelWin;
   const { store, client, selectors, actions } = panel.getVarsForTests();
 
   return {
     actions: actions,
     selectors: selectors,
     getState: store.getState,
     store: store,
@@ -71,17 +71,17 @@ const DOCUMENT_SRC = "<style>" +
 
 const TEST_URI = "data:text/html;charset=utf-8," + DOCUMENT_SRC;
 
 add_task(async function() {
   const { inspector, toolbox, testActor } = await openInspectorForURL(TEST_URI);
 
   const target = await TargetFactory.forTab(gBrowser.selectedTab);
   await gDevTools.showToolbox(target, "jsdebugger");
-  const dbg = createDebuggerContext(toolbox);
+  const dbg = await createDebuggerContext(toolbox);
 
   await waitForPaused(dbg);
 
   await gDevTools.showToolbox(target, "inspector");
 
   // Needed to get this test to pass consistently :(
   await waitForTime(1000);