Bug 1300036 - Ensure waiting for source shown when reloading tab in debugger tests. r=ejpbruel
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 05 Sep 2016 10:38:25 -0700
changeset 355267 d9a19f976f1e30e01b240372099098e67c167603
parent 355266 8f7f5ce39b7d4e1dc2e12d9ac4f5fed945867a18
child 355268 73f77b885f17cb75069196258a6448490b543d15
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersejpbruel
bugs1300036
milestone51.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 1300036 - Ensure waiting for source shown when reloading tab in debugger tests. r=ejpbruel 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));
       });
   });
 }