Backed out changeset f057b78337e7 (bug 1544436) for debugger failures on addToTree.js CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Mon, 15 Apr 2019 20:46:25 +0300
changeset 469532 9c2a65500d3a
parent 469531 7d37a22773a0
child 469533 b02881ec59d7
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1544436
milestone68.0a1
backs outf057b78337e7
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
Backed out changeset f057b78337e7 (bug 1544436) for debugger failures on addToTree.js CLOSED TREE
devtools/client/debugger/src/actions/pause/paused.js
devtools/client/debugger/src/utils/sources-tree/addToTree.js
devtools/client/debugger/src/utils/sources-tree/createTree.js
devtools/client/debugger/src/utils/sources-tree/tests/addToTree.spec.js
devtools/client/debugger/src/utils/sources-tree/updateTree.js
--- a/devtools/client/debugger/src/actions/pause/paused.js
+++ b/devtools/client/debugger/src/actions/pause/paused.js
@@ -2,23 +2,25 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
 
 // @flow
 import {
   getHiddenBreakpoint,
   isEvaluatingExpression,
   getSelectedFrame,
+  wasStepping,
   getThreadContext
 } from "../../selectors";
 
 import { mapFrames } from ".";
 import { removeBreakpoint } from "../breakpoints";
 import { evaluateExpressions } from "../expressions";
 import { selectLocation } from "../sources";
+import { togglePaneCollapse } from "../ui";
 import assert from "../../utils/assert";
 
 import { fetchScopes } from "./fetchScopes";
 
 import type { Pause } from "../../types";
 import type { ThunkArgs } from "../types";
 
 /**
@@ -53,16 +55,20 @@ export function paused(pauseInfo: Pause)
 
     await dispatch(mapFrames(cx));
 
     const selectedFrame = getSelectedFrame(getState(), thread);
     if (selectedFrame) {
       await dispatch(selectLocation(cx, selectedFrame.location));
     }
 
+    if (!wasStepping(getState(), thread)) {
+      dispatch(togglePaneCollapse("end", false));
+    }
+
     await dispatch(fetchScopes(cx));
 
     // Run after fetching scoping data so that it may make use of the sourcemap
     // expression mappings for local variables.
     const atException = why.type == "exception";
     if (!atException || !isEvaluatingExpression(getState(), thread)) {
       await dispatch(evaluateExpressions(cx));
     }
--- a/devtools/client/debugger/src/utils/sources-tree/addToTree.js
+++ b/devtools/client/debugger/src/utils/sources-tree/addToTree.js
@@ -152,17 +152,18 @@ function addSourceToNode(
 
 /**
  * @memberof utils/sources-tree
  * @static
  */
 export function addToTree(
   tree: TreeDirectory,
   source: Source,
-  debuggeeHost: ?string
+  debuggeeHost: ?string,
+  projectRoot: string
 ) {
   const url = getURL(source, debuggeeHost);
 
   if (isInvalidUrl(url, source)) {
     return;
   }
 
   const finalNode = traverseTree(url, tree, debuggeeHost);
--- a/devtools/client/debugger/src/utils/sources-tree/createTree.js
+++ b/devtools/client/debugger/src/utils/sources-tree/createTree.js
@@ -9,26 +9,27 @@ import { collapseTree } from "./collapse
 import { createDirectoryNode, createParentMap } from "./utils";
 import { getDomain } from "./treeOrder";
 
 import type { SourcesMap } from "../../reducers/types";
 import type { TreeDirectory } from "./types";
 
 type Params = {
   sources: SourcesMap,
-  debuggeeUrl: string
+  debuggeeUrl: string,
+  projectRoot: string
 };
 
-export function createTree({ sources, debuggeeUrl }: Params) {
+export function createTree({ sources, debuggeeUrl, projectRoot }: Params) {
   const uncollapsedTree = createDirectoryNode("root", "", []);
   const debuggeeHost = getDomain(debuggeeUrl);
 
   for (const sourceId in sources) {
     const source = sources[sourceId];
-    addToTree(uncollapsedTree, source, debuggeeHost);
+    addToTree(uncollapsedTree, source, debuggeeHost, projectRoot);
   }
 
   const sourceTree = collapseTree((uncollapsedTree: TreeDirectory));
 
   return {
     uncollapsedTree,
     sourceTree,
     parentMap: createParentMap(sourceTree)
--- a/devtools/client/debugger/src/utils/sources-tree/tests/addToTree.spec.js
+++ b/devtools/client/debugger/src/utils/sources-tree/tests/addToTree.spec.js
@@ -101,17 +101,16 @@ describe("sources-tree", () => {
       const source1 = makeMockSource(
         `https://example.com/foo/${sourceName}`,
         "actor1"
       );
 
       const tree = createDirectoryNode("root", "", []);
 
       addToTree(tree, source1, "http://example.com/", "");
-      console.log(formatTree(tree));
       expect(formatTree(tree)).toMatchSnapshot();
     });
 
     it("does not attempt to add two of the same directory", () => {
       const sources = [
         {
           id: "server1.conn13.child1/39",
           url: "https://davidwalsh.name/wp-content/prism.js"
--- a/devtools/client/debugger/src/utils/sources-tree/updateTree.js
+++ b/devtools/client/debugger/src/utils/sources-tree/updateTree.js
@@ -29,24 +29,25 @@ type Params = {
   debuggeeUrl: string,
   projectRoot: string
 };
 
 export function updateTree({
   newSources,
   prevSources,
   debuggeeUrl,
+  projectRoot,
   uncollapsedTree,
   sourceTree
 }: Params) {
   const newSet = newSourcesSet(newSources, prevSources);
   const debuggeeHost = getDomain(debuggeeUrl);
 
   for (const source of newSet) {
-    addToTree(uncollapsedTree, source, debuggeeHost);
+    addToTree(uncollapsedTree, source, debuggeeHost, projectRoot);
   }
 
   const newSourceTree = collapseTree(uncollapsedTree);
 
   return {
     uncollapsedTree,
     sourceTree: newSourceTree,
     parentMap: createParentMap(newSourceTree)