Bug 1527122 - [release 125] [sync] Bug 1526247 - Rename webconsole-output-wrapper; r=bgrins.. r=dwalsh
authorJason Laster <jlaster@mozilla.com>
Mon, 11 Feb 2019 16:59:05 -0800
changeset 458677 1d241f19a409f83a294936199f5d3c1fcadbd02c
parent 458648 134b85ae973cb92917cedc21ac624e75a8f27406
child 458678 01c2f5e1c6db10ab9d40fe717bd17770fa6a524c
push id35544
push userccoroiu@mozilla.com
push dateTue, 12 Feb 2019 16:29:08 +0000
treeherdermozilla-central@c849fb69e2e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins, dwalsh
bugs1527122, 1526247
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 1527122 - [release 125] [sync] Bug 1526247 - Rename webconsole-output-wrapper; r=bgrins.. r=dwalsh
devtools/client/debugger/new/src/actions/breakpoints/addBreakpoint.js
devtools/client/debugger/new/src/actions/breakpoints/index.js
devtools/client/debugger/new/src/actions/breakpoints/syncBreakpoint.js
devtools/client/debugger/new/src/client/firefox/commands.js
devtools/client/debugger/new/src/client/firefox/types.js
devtools/client/debugger/new/src/utils/breakpoint/index.js
devtools/client/debugger/new/src/utils/prefs.js
devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js
devtools/client/debugger/new/test/mochitest/helpers.js
--- a/devtools/client/debugger/new/src/actions/breakpoints/addBreakpoint.js
+++ b/devtools/client/debugger/new/src/actions/breakpoints/addBreakpoint.js
@@ -11,17 +11,16 @@ import {
   getASTLocation,
   assertLocation,
   makeBreakpointId,
   makeBreakpointLocation
 } from "../../utils/breakpoint";
 import { PROMISE } from "../utils/middleware/promise";
 import {
   getSource,
-  getSourceActors,
   getSymbols,
   getFirstVisibleBreakpointPosition
 } from "../../selectors";
 import { getGeneratedLocation } from "../../utils/source-maps";
 import { getTextAtPosition } from "../../utils/source";
 import { recordEvent } from "../../utils/telemetry";
 import { features } from "../../utils/prefs";
 import { setBreakpointPositions } from "./breakpointPositions";
@@ -66,17 +65,20 @@ async function addBreakpointPromise(getS
   assertLocation(generatedLocation);
 
   if (breakpointExists(state, location)) {
     const newBreakpoint = { ...breakpoint, location, generatedLocation };
     assertBreakpoint(newBreakpoint);
     return newBreakpoint;
   }
 
-  const breakpointLocation = makeBreakpointLocation(getState(), generatedLocation);
+  const breakpointLocation = makeBreakpointLocation(
+    getState(),
+    generatedLocation
+  );
   await client.setBreakpoint(breakpointLocation, breakpoint.options);
 
   const symbols = getSymbols(getState(), source);
   const astLocation = await getASTLocation(source, symbols, location);
 
   const originalText = getTextAtPosition(source, location);
   const text = getTextAtPosition(generatedSource, generatedLocation);
 
--- a/devtools/client/debugger/new/src/actions/breakpoints/index.js
+++ b/devtools/client/debugger/new/src/actions/breakpoints/index.js
@@ -12,18 +12,17 @@
 import { PROMISE } from "../utils/middleware/promise";
 import {
   getBreakpoint,
   getBreakpointsList,
   getXHRBreakpoints,
   getSelectedSource,
   getBreakpointAtLocation,
   getConditionalPanelLocation,
-  getBreakpointsForSource,
-  getSourceActors
+  getBreakpointsForSource
 } from "../../selectors";
 import {
   assertBreakpoint,
   createXHRBreakpoint,
   makeBreakpointLocation
 } from "../../utils/breakpoint";
 import {
   addBreakpoint,
@@ -44,17 +43,20 @@ import type {
   Source,
   SourceLocation,
   XHRBreakpoint
 } from "../../types";
 
 import { recordEvent } from "../../utils/telemetry";
 
 async function removeBreakpointsPromise(client, state, breakpoint) {
-  const breakpointLocation = makeBreakpointLocation(state, breakpoint.generatedLocation);
+  const breakpointLocation = makeBreakpointLocation(
+    state,
+    breakpoint.generatedLocation
+  );
   await client.removeBreakpoint(breakpointLocation);
 }
 
 /**
  * Remove a single breakpoint
  *
  * @memberof actions/breakpoints
  * @static
@@ -288,17 +290,21 @@ export function setBreakpointOptions(
     if (bp.loading) {
       return;
     }
 
     if (bp.disabled) {
       await dispatch(enableBreakpoint(bp));
     }
 
-    const breakpointLocation = makeBreakpointLocation(getState(), bp.generatedLocation);
+    const breakpointLocation = makeBreakpointLocation(
+      getState(),
+      bp.generatedLocation
+    );
+
     await client.setBreakpoint(breakpointLocation, options);
 
     const newBreakpoint = { ...bp, disabled: false, options };
 
     assertBreakpoint(newBreakpoint);
 
     return dispatch(
       ({
--- a/devtools/client/debugger/new/src/actions/breakpoints/syncBreakpoint.js
+++ b/devtools/client/debugger/new/src/actions/breakpoints/syncBreakpoint.js
@@ -6,24 +6,23 @@
 
 import { setBreakpointPositions } from "./breakpointPositions";
 import {
   locationMoved,
   createBreakpoint,
   assertBreakpoint,
   assertPendingBreakpoint,
   findScopeByName,
-  makeSourceActorLocation,
   makeBreakpointLocation
 } from "../../utils/breakpoint";
 
 import { getGeneratedLocation } from "../../utils/source-maps";
 import { getTextAtPosition } from "../../utils/source";
 import { originalToGeneratedId, isOriginalId } from "devtools-source-map";
-import { getSource, getSourceActors } from "../../selectors";
+import { getSource } from "../../selectors";
 import { features } from "../../utils/prefs";
 
 import type { ThunkArgs, Action } from "../types";
 
 import type {
   SourceLocation,
   ASTLocation,
   PendingBreakpoint,
@@ -127,19 +126,20 @@ export async function syncBreakpointProm
   );
 
   // makeBreakpointLocation requires the source to still exist, which might not
   // be the case if we navigated.
   if (!getSource(getState(), generatedSourceId)) {
     return null;
   }
 
-  const breakpointLocation = makeBreakpointLocation(getState(), generatedLocation);
-  const scopedBreakpointLocation =
-    makeBreakpointLocation(getState(), scopedGeneratedLocation);
+  const breakpointLocation = makeBreakpointLocation(
+    getState(),
+    generatedLocation
+  );
 
   let possiblePosition = true;
   if (features.columnBreakpoints && generatedLocation.column != undefined) {
     const { positions } = await dispatch(
       setBreakpointPositions(generatedLocation)
     );
     if (!positions.includes(generatedLocation.column)) {
       possiblePosition = false;
@@ -172,22 +172,20 @@ export async function syncBreakpointProm
 
   if (!possiblePosition || !scopedGeneratedLocation.line) {
     return { previousLocation, breakpoint: null };
   }
 
   /** ******* Case 2: Add New Breakpoint ***********/
   // If we are not disabled, set the breakpoint on the server and get
   // that info so we can set it on our breakpoints.
-
-  if (!scopedGeneratedLocation.line) {
-    return { previousLocation, breakpoint: null };
-  }
-
-  await client.setBreakpoint(scopedGeneratedLocation, pendingBreakpoint.options);
+  await client.setBreakpoint(
+    scopedGeneratedLocation,
+    pendingBreakpoint.options
+  );
 
   const originalText = getTextAtPosition(source, scopedLocation);
   const text = getTextAtPosition(generatedSource, scopedGeneratedLocation);
 
   return createSyncData(
     pendingBreakpoint,
     scopedLocation,
     scopedGeneratedLocation,
--- a/devtools/client/debugger/new/src/client/firefox/commands.js
+++ b/devtools/client/debugger/new/src/client/firefox/commands.js
@@ -1,14 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 { createSource, createWorker } from "./create";
+import { supportsWorkers, updateWorkerClients } from "./workers";
+import { features } from "../../utils/prefs";
+
 import type {
   ActorId,
   BreakpointLocation,
   BreakpointOptions,
   BreakpointResult,
   EventListenerBreakpoints,
   Frame,
   FrameId,
@@ -25,23 +29,16 @@ import type {
   Grip,
   ThreadClient,
   ObjectClient,
   SourcesPacket
 } from "./types";
 
 import type { PausePointsMap } from "../../workers/parser";
 
-import { makeBreakpointActorId } from "../../utils/breakpoint";
-
-import { createSource, createWorker } from "./create";
-import { supportsWorkers, updateWorkerClients } from "./workers";
-
-import { features } from "../../utils/prefs";
-
 let workerClients: Object;
 let threadClient: ThreadClient;
 let tabTarget: TabTarget;
 let debuggerClient: DebuggerClient;
 let sourceActors: { [ActorId]: SourceId };
 let breakpoints: { [string]: Object };
 let supportsWasm: boolean;
 
--- a/devtools/client/debugger/new/src/client/firefox/types.js
+++ b/devtools/client/debugger/new/src/client/firefox/types.js
@@ -144,30 +144,16 @@ export type PausedPacket = {
 };
 
 export type ResumedPacket = {
   from: ActorId,
   type: string
 };
 
 /**
- * Location of an actual event, when breakpoints are set they are requested
- * at one location but the server will respond with the "actual location" where
- * the breakpoint was really set if it differs from the requested location.
- *
- * @memberof firefox
- * @static
- */
-export type ActualLocation = {
-  source: SourcePayload,
-  line: number,
-  column?: number
-};
-
-/**
  * Response from the `getFrames` function call
  * @memberof firefox
  * @static
  */
 export type FramesResponse = {
   frames: FramePacket[],
   from: ActorId
 };
@@ -362,17 +348,17 @@ export type ThreadClient = {
   reverseStepOver: Function => Promise<*>,
   reverseStepOut: Function => Promise<*>,
   breakOnNext: () => Promise<*>,
   // FIXME: unclear if SourceId or ActorId here
   source: ({ actor: SourceId }) => SourceClient,
   pauseGrip: (Grip | Function) => ObjectClient,
   pauseOnExceptions: (boolean, boolean) => Promise<*>,
   setBreakpoint: (BreakpointLocation, BreakpointOptions) => Promise<*>,
-  removeBreakpoint: (BreakpointLocation) => Promise<*>,
+  removeBreakpoint: BreakpointLocation => Promise<*>,
   setXHRBreakpoint: (path: string, method: string) => Promise<boolean>,
   removeXHRBreakpoint: (path: string, method: string) => Promise<boolean>,
   interrupt: () => Promise<*>,
   eventListeners: () => Promise<*>,
   getFrames: (number, number) => FramesResponse,
   getEnvironment: (frame: Frame) => Promise<*>,
   addListener: (string, Function) => void,
   getSources: () => Promise<SourcesPacket>,
--- a/devtools/client/debugger/new/src/utils/breakpoint/index.js
+++ b/devtools/client/debugger/new/src/utils/breakpoint/index.js
@@ -64,17 +64,20 @@ export function makePendingLocationId(lo
   assertPendingLocation(location);
   const { sourceUrl, line, column } = location;
   const sourceUrlString = sourceUrl || "";
   const columnString = column || "";
 
   return `${sourceUrlString}:${line}:${columnString}`;
 }
 
-export function makeBreakpointLocation(state: State, location: SourceLocation): BreakpointLocation {
+export function makeBreakpointLocation(
+  state: State,
+  location: SourceLocation
+): BreakpointLocation {
   const source = getSource(state, location.sourceId);
   if (!source) {
     throw new Error("no source");
   }
   const breakpointLocation: any = {
     line: location.line,
     column: location.column
   };
--- a/devtools/client/debugger/new/src/utils/prefs.js
+++ b/devtools/client/debugger/new/src/utils/prefs.js
@@ -4,17 +4,17 @@
 
 // @flow
 
 import { PrefsHelper } from "devtools-modules";
 import { isDevelopment } from "devtools-environment";
 import Services from "devtools-services";
 import { asyncStoreHelper } from "./asyncStoreHelper";
 
-const prefsSchemaVersion = "1.0.6";
+const prefsSchemaVersion = "1.0.7";
 
 const pref = Services.pref;
 
 if (isDevelopment()) {
   pref("devtools.debugger.logging", false);
   pref("devtools.debugger.alphabetize-outline", false);
   pref("devtools.debugger.auto-pretty-print", false);
   pref("devtools.source-map.client-service.enabled", true);
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js
@@ -1,10 +1,11 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/>. */
 
 function findBreakpoint(dbg, url, line, column = 0) {
   const {
     selectors: { getBreakpoint },
     getState
   } = dbg;
   const source = findSource(dbg, url);
   const location = { sourceId: source.id, line, column };
@@ -16,20 +17,17 @@ function getLineEl(dbg, line) {
   return lines[line - 1];
 }
 
 function assertEditorBreakpoint(dbg, line, shouldExist) {
   const exists = getLineEl(dbg, line).classList.contains("has-condition");
 
   ok(
     exists === shouldExist,
-    "Breakpoint " +
-      (shouldExist ? "exists" : "does not exist") +
-      " on line " +
-      line
+    `Breakpoint ${shouldExist ? "exists" : "does not exist"} on line ${line}`
   );
 }
 
 function waitForElementFocus(dbg, el) {
   const doc = dbg.win.document;
   return waitFor(() => doc.activeElement == el && doc.hasFocus());
 }
 
@@ -70,16 +68,17 @@ add_task(async function() {
   let bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, "1", "breakpoint is created with the condition");
   assertEditorBreakpoint(dbg, 5, true);
 
   // Edit the conditional breakpoint set above
   const bpCondition1 = waitForDispatch(dbg, "SET_BREAKPOINT_OPTIONS");
   await setConditionalBreakpoint(dbg, 5, "2");
   await bpCondition1;
+
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, "12", "breakpoint is created with the condition");
   assertEditorBreakpoint(dbg, 5, true);
 
   clickElement(dbg, "gutter", 5);
   await waitForDispatch(dbg, "REMOVE_BREAKPOINT");
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp, null, "breakpoint was removed");
@@ -92,16 +91,16 @@ add_task(async function() {
   await setConditionalBreakpoint(dbg, 5, "1");
   await bpCondition2;
 
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, "1", "breakpoint is created with the condition");
   assertEditorBreakpoint(dbg, 5, true);
 
   const bpCondition3 = waitForDispatch(dbg, "SET_BREAKPOINT_OPTIONS");
-  //right click breakpoint in breakpoints list
-  rightClickElement(dbg, "breakpointItem", 3)
+  // right click breakpoint in breakpoints list
+  rightClickElement(dbg, "breakpointItem", 3);
   // select "remove condition";
   selectContextMenuItem(dbg, selectors.breakpointContextMenu.removeCondition);
   await bpCondition3;
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, undefined, "breakpoint condition removed");
 });
--- a/devtools/client/debugger/new/test/mochitest/helpers.js
+++ b/devtools/client/debugger/new/test/mochitest/helpers.js
@@ -763,19 +763,19 @@ function findBreakpoint(dbg, url, line) 
     getState
   } = dbg;
   const source = findSource(dbg, url);
   let column;
   if (
     Services.prefs.getBoolPref("devtools.debugger.features.column-breakpoints")
   ) {
     ({ column } = dbg.selectors.getFirstVisibleBreakpointPosition(
-      dbg.store.getState(), 
+      dbg.store.getState(),
       {
-        sourceId: source.id, 
+        sourceId: source.id,
         line
       }
     ));
   }
   return getBreakpoint(getState(), { sourceId: source.id, line, column });
 }
 
 async function loadAndAddBreakpoint(dbg, filename, line, column) {
@@ -1101,17 +1101,17 @@ const selectors = {
     removeOthers: "#node-menu-delete-other",
     removeCondition: "#node-menu-remove-condition"
   },
   scopes: ".scopes-list",
   scopeNode: i => `.scopes-list .tree-node:nth-child(${i}) .object-label`,
   scopeValue: i =>
     `.scopes-list .tree-node:nth-child(${i}) .object-delimiter + *`,
   frame: i => `.frames [role="list"] [role="listitem"]:nth-child(${i})`,
-  frames: `.frames [role="list"] [role="listitem"]`,
+  frames: '.frames [role="list"] [role="listitem"]',
   gutter: i => `.CodeMirror-code *:nth-child(${i}) .CodeMirror-linenumber`,
   // These work for bobth the breakpoint listing and gutter marker
   gutterContextMenu: {
     addConditionalBreakpoint:
       "#node-menu-add-condition, #node-menu-add-conditional-breakpoint",
     editConditionalBreakpoint:
       "#node-menu-edit-condition, #node-menu-edit-conditional-breakpoint"
   },