Bug 1548390 Double click logpoint in secondary pane opens logpoint panel r=davidwalsh
authorchujun <chujunlu@hotmail.com>
Wed, 08 May 2019 14:06:08 +0000
changeset 473075 1c914f89d39582a35e96e22542cd4fd99e2dc663
parent 473074 af207309bcf591289490bb78a11412975a559574
child 473076 61e59c0325ddeba0bfe6a3624a60d0e7150ac632
push id85012
push userdwalsh@mozilla.com
push dateWed, 08 May 2019 14:07:48 +0000
treeherderautoland@1c914f89d395 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidwalsh
bugs1548390
milestone68.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 1548390 Double click logpoint in secondary pane opens logpoint panel r=davidwalsh Add an `if` statement to handle logpoint when double click. Add Mochitest for both conditional breakpoint and logpoint Differential Revision: https://phabricator.services.mozilla.com/D30291
devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js
devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond.js
devtools/client/debugger/test/mochitest/helpers.js
--- a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/Breakpoint.js
@@ -73,16 +73,18 @@ class Breakpoint extends PureComponent<P
     const { breakpoint, selectedSource } = this.props;
     return getSelectedLocation(breakpoint, selectedSource);
   }
 
   onDoubleClick = () => {
     const { breakpoint, openConditionalPanel } = this.props;
     if (breakpoint.options.condition) {
       openConditionalPanel(this.selectedLocation);
+    } else if (breakpoint.options.logValue) {
+      openConditionalPanel(this.selectedLocation, true);
     }
   };
 
   selectBreakpoint = event => {
     event.preventDefault();
     const { cx, selectSpecificLocation } = this.props;
     selectSpecificLocation(cx, this.selectedLocation);
   };
--- a/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-breakpoints-cond.js
@@ -118,16 +118,29 @@ add_task(async function() {
   await waitForDispatch(dbg, "SET_BREAKPOINT");
   await setConditionalBreakpoint(dbg, 5, "1");
   await waitForCondition(dbg, 1);
 
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, "1", "breakpoint is created with the condition");
   await assertEditorBreakpoint(dbg, 5, { hasCondition: true });
 
+  info("Double click the conditional breakpoint in secondary pane");
+  dblClickElement(dbg, "conditionalBreakpointInSecPane");
+  is(
+    dbg.win.document.activeElement.tagName,
+    "TEXTAREA",
+    "The textarea of conditional breakpoint panel is focused"
+  );
+  
+  info("Click the conditional breakpoint in secondary pane");
+  await clickElement(dbg, "conditionalBreakpointInSecPane");
+  let conditonalPanel = findElement(dbg, "conditionalPanel");
+  is(conditonalPanel, null, "The conditional breakpoint panel is closed");
+
   rightClickElement(dbg, "breakpointItem", 2);
   info('select "remove condition"');
   selectContextMenuItem(dbg, selectors.breakpointContextMenu.removeCondition);
   await waitForBreakpointWithoutCondition(dbg, "simple2", 5);
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.condition, undefined, "breakpoint condition removed");
 
   info('Add "log point"');
@@ -136,9 +149,22 @@ add_task(async function() {
   await assertEditorBreakpoint(dbg, 5, { hasLog: true });
 
   bp = findBreakpoint(dbg, "simple2", 5);
   is(bp.options.logValue, "44", "breakpoint condition removed");
 
   await altClickElement(dbg, "gutter", 6);
   bp = await waitForBreakpoint(dbg, "simple2", 6);
   is(bp.options.logValue, "displayName", "logPoint has default value");
+
+  info("Double click the logpoint in secondary pane");
+  dblClickElement(dbg, "logPointInSecPane");
+  is(
+    dbg.win.document.activeElement.tagName,
+    "TEXTAREA",
+    "The textarea of logpoint panel is focused"
+  );
+  
+  info("Click the logpoint in secondary pane");
+  await clickElement(dbg, "logPointInSecPane");
+  let logPointPanel = findElement(dbg, "logPointPanel");
+  is(logPointPanel, null, "The logpoint panel is closed");
 });
--- a/devtools/client/debugger/test/mochitest/helpers.js
+++ b/devtools/client/debugger/test/mochitest/helpers.js
@@ -1252,17 +1252,21 @@ const selectors = {
   fileMatch: ".project-text-search .line-value",
   popup: ".popover",
   tooltip: ".tooltip",
   previewPopup: ".preview-popup",
   openInspector: "button.open-inspector",
   outlineItem: i =>
     `.outline-list__element:nth-child(${i}) .function-signature`,
   outlineItems: ".outline-list__element",
+  conditionalPanel: ".conditional-breakpoint-panel",
   conditionalPanelInput: ".conditional-breakpoint-panel textarea",
+  conditionalBreakpointInSecPane: ".breakpoint.is-conditional",
+  logPointPanel: ".conditional-breakpoint-panel.log-point",
+  logPointInSecPane: ".breakpoint.is-log",
   searchField: ".search-field",
   blackbox: ".action.black-box",
   projectSearchCollapsed: ".project-text-search .arrow:not(.expanded)",
   projectSerchExpandedResults: ".project-text-search .result",
   threadsPaneItems: ".workers-pane .worker",
   threadsPaneItem: i => `.workers-pane .worker:nth-child(${i})`,
   threadsPaneItemPause: i => `${selectors.threadsPaneItem(i)} .pause-badge`,
   CodeMirrorLines: ".CodeMirror-lines"