Bug 1300036 - Ensure waiting for source shown when reloading tab in debugger tests. r=ejpbruel, a=test-only
☠☠ backed out by ab97d0cfa0a3 ☠ ☠
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 05 Sep 2016 10:38:25 -0700
changeset 350439 620464bdbdfff5eeea1eb2b1194934cecb879c54
parent 350438 14bd404a269a6721c68a802e708f1465c9576b2c
child 350440 84899036528a2504b2da757c25f1d79bebf0c6b5
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersejpbruel, test-only
bugs1300036
milestone50.0
Bug 1300036 - Ensure waiting for source shown when reloading tab in debugger tests. r=ejpbruel, a=test-only MozReview-Commit-ID: 9R5R3SWawEb
devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-reload.js
devtools/client/debugger/test/mochitest/browser_dbg_location-changes-03-new.js
devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-reload.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-reload.js
@@ -22,19 +22,18 @@ var test = Task.async(function* () {
 
   const sources = panel.panelWin.DebuggerView.Sources;
   yield actions.addBreakpoint({
     actor: sources.selectedValue,
     line: 10 // "break on me" string
   });
 
   const paused = waitForThreadEvents(panel, "paused");
-  reloadActiveTab(panel);
+  yield reloadActiveTab(panel, panel.panelWin.EVENTS.SOURCE_SHOWN);
   const packet = yield paused;
 
   is(packet.why.type, "breakpoint",
      "Should have hit the breakpoint after the reload");
   is(packet.frame.where.line, 10,
      "Should have stopped at line 10, where we set the breakpoint");
 
-  yield waitForDebuggerEvents(panel, panel.panelWin.EVENTS.SOURCE_SHOWN);
   yield resumeDebuggerThenCloseAndFinish(panel);
 });
--- a/devtools/client/debugger/test/mochitest/browser_dbg_location-changes-03-new.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_location-changes-03-new.js
@@ -27,17 +27,17 @@ function test() {
 
     Task.spawn(function* () {
       let onCaretUpdated = waitForCaretUpdated(gPanel, 14);
       callInTab(gTab, "simpleCall");
       yield onCaretUpdated;
 
       const startedLoading = waitForNextDispatch(gDebugger.DebuggerController,
                                                  constants.LOAD_SOURCE_TEXT);
-      navigateActiveTabTo(gPanel, TAB_URL_2);
+      navigateActiveTabTo(gPanel, TAB_URL_2, gDebugger.EVENTS.SOURCE_SHOWN);
       yield startedLoading;
 
       isnot(gDebugger.gThreadClient.state, "paused",
             "Should not be paused after a tab navigation.");
       is(gFrames.itemCount, 0,
          "Should have no frames.");
       is(gSources.itemCount, 1,
          "Found the expected number of entries in the sources widget.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_pretty-print-11.js
@@ -26,18 +26,18 @@ function test() {
     gSources = gDebugger.DebuggerView.Sources;
 
     testSourceIsUgly();
     const finished = waitForCaretUpdated(gPanel, 7);
     clickPrettyPrintButton();
     finished.then(testSourceIsPretty)
       .then(() => {
         const finished = waitForCaretUpdated(gPanel, 7);
-        reloadActiveTab(gPanel);
-        return finished;
+        const reloaded = reloadActiveTab(gPanel, gDebugger.EVENTS.SOURCE_SHOWN);
+        return Promise.all([finished, reloaded]);
       })
       .then(testSourceIsPretty)
       .then(() => resumeDebuggerThenCloseAndFinish(gPanel))
       .then(null, aError => {
         ok(false, "Got an error: " + DevToolsUtils.safeErrorString(aError));
       });
   });
 }