Bug 1523421 - Always view source map original URLs in the debugger, r=jlast.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 28 Jan 2019 12:18:56 -1000
changeset 456653 0bf6dc15543905faed5da227903febefa69ab575
parent 456652 3d835071d1604e99978933b2ae98611580a728dc
child 456654 729628913bbf77b3b9e902f2c6e9b6d2b0aa72cf
push id35499
push userccoroiu@mozilla.com
push dateMon, 04 Feb 2019 21:42:59 +0000
treeherdermozilla-central@a27965fa7374 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1523421
milestone67.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 1523421 - Always view source map original URLs in the debugger, r=jlast.
devtools/client/shared/view-source.js
devtools/client/webconsole/test/mochitest/head.js
--- a/devtools/client/shared/view-source.js
+++ b/devtools/client/shared/view-source.js
@@ -47,17 +47,17 @@ exports.viewSourceInStyleEditor = async 
  * @param {string} [reason=unknown]
  *
  * @return {Promise<boolean>}
  */
 exports.viewSourceInDebugger = async function(toolbox, sourceURL, sourceLine,
                                               reason = "unknown") {
   const dbg = await toolbox.loadTool("jsdebugger");
   const source = dbg.getSource(sourceURL);
-  if (source) {
+  if (source || await toolbox.sourceMapService.hasOriginalURL(sourceURL)) {
     await toolbox.selectTool("jsdebugger", reason);
     dbg.selectSource(sourceURL, sourceLine);
     return true;
   }
 
   exports.viewSource(toolbox, sourceURL, sourceLine);
   return false;
 };
--- a/devtools/client/webconsole/test/mochitest/head.js
+++ b/devtools/client/webconsole/test/mochitest/head.js
@@ -358,16 +358,22 @@ async function checkClickOnNode(hud, too
   const onSourceInDebuggerOpened = once(hud.ui, "source-in-debugger-opened");
 
   EventUtils.sendMouseEvent({ type: "click" },
     frameLinkNode.querySelector(".frame-link-filename"));
 
   await onSourceInDebuggerOpened;
 
   const dbg = toolbox.getPanel("jsdebugger");
+
+  // Wait for the source to finish loading, if it is pending.
+  await waitFor(() => {
+    return !!dbg._selectors.getSelectedSource(dbg._getState());
+  });
+
   is(
     dbg._selectors.getSelectedSource(dbg._getState()).url,
     url,
     "expected source url"
   );
 }
 
 /**