Backed out changeset c39d389d140c (bug 1630742) for devtools failures in devtools/client/debugger/test/mochitest/browser_dbg-continue-to-here-click.js

This commit is contained in:
Stefan Hindli 2020-04-23 06:54:52 +03:00
parent 603de7bc14
commit da540f28d4
7 changed files with 11 additions and 62 deletions

View File

@ -21,7 +21,6 @@ const blacklist = [
"SET_FOCUSED_SOURCE_ITEM",
"NODE_EXPAND",
"IN_SCOPE_LINES",
"SET_PREVIEW",
];
function cloneAction(action: any) {

View File

@ -79,18 +79,6 @@ import {
} from "../../utils/editor";
import { resizeToggleButton, resizeBreakpointGutter } from "../../utils/ui";
import Services from "devtools-services";
const { appinfo } = Services;
const isMacOS = appinfo.OS === "Darwin";
function isSecondary(ev) {
return isMacOS && ev.ctrlKey && ev.button === 0;
}
function isCmd(ev) {
return isMacOS ? ev.metaKey : ev.ctrlKey;
}
import "./Editor.css";
import "./Breakpoints.css";
@ -471,7 +459,7 @@ class Editor extends PureComponent<Props, State> {
} = this.props;
// ignore right clicks in the gutter
if (isSecondary(ev) || ev.button === 2 || !selectedSource) {
if ((ev.ctrlKey && ev.button === 0) || ev.button === 2 || !selectedSource) {
return;
}
@ -493,12 +481,8 @@ class Editor extends PureComponent<Props, State> {
return;
}
if (isCmd(ev)) {
return continueToHere(cx, {
line: sourceLine,
column: undefined,
sourceId: selectedSource.id,
});
if (ev.metaKey) {
return continueToHere(cx, sourceLine);
}
return addBreakpointAtLine(cx, sourceLine, ev.altKey, ev.shiftKey);

View File

@ -44,8 +44,6 @@ skip-if = debug # Window leaks: bug 1575332
[browser_dbg-browser-content-toolbox.js]
skip-if = !e10s || verify # This test is only valid in e10s
[browser_dbg-continue-to-here.js]
[browser_dbg-continue-to-here-click.js]
skip-if = debug
[browser_dbg-breakpoints-reloading.js]
[browser_dbg-breakpoint-skipping.js]
[browser_dbg-breakpoint-skipping-console.js]

View File

@ -1,23 +0,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/>. */
async function cmdClickLine(dbg, line) {
await cmdClickGutter(dbg, line);
}
add_task(async function() {
const dbg = await initDebugger("doc-pause-points.html", "pause-points.js");
await selectSource(dbg, "pause-points.js");
await waitForSelectedSource(dbg, "pause-points.js");
info("Test cmd+click continueing to a line");
clickElementInTab("#sequences");
await waitForPaused(dbg);
await waitForInlinePreviews(dbg);
await cmdClickLine(dbg, 31);
await waitForPausedLine(dbg, 31);
assertDebugLine(dbg, 31, 4);
await resume(dbg);
await waitForRequestsToSettle(dbg);
});

View File

@ -6,8 +6,7 @@ async function continueToLine(dbg, line) {
rightClickElement(dbg, "gutter", line);
selectContextMenuItem(dbg, selectors.editorContextMenu.continueToHere);
await waitForDispatch(dbg, "RESUME");
await waitForPaused(dbg);
await waitForInlinePreviews(dbg);
return waitForPaused(dbg);
}
async function continueToColumn(dbg, pos) {
@ -29,7 +28,7 @@ add_task(async function() {
await waitForPaused(dbg);
await waitForInlinePreviews(dbg);
await continueToLine(dbg, 31);
await continueToColumn(dbg, { line: 31, ch: 7 });
assertDebugLine(dbg, 31, 4);
await resume(dbg);
@ -39,6 +38,7 @@ add_task(async function() {
await waitForInlinePreviews(dbg);
await continueToColumn(dbg, { line: 31, ch: 7 });
assertDebugLine(dbg, 31, 4);
await resume(dbg);
});

View File

@ -44,6 +44,7 @@ Services.scriptloader.loadSubScript(
const EXAMPLE_URL =
"http://example.com/browser/devtools/client/debugger/test/mochitest/examples/";
// NOTE: still experimental, the screenshots might not be exactly correct
async function takeScreenshot(dbg) {
let canvas = dbg.win.document.createElementNS(

View File

@ -319,10 +319,6 @@ function getVisibleSelectedFrameLine(dbg) {
return frame && frame.location.line;
}
function waitForPausedLine(dbg, line) {
return waitForState(dbg, () => getVisibleSelectedFrameLine(dbg) == line);
}
/**
* Assert that the debugger is paused at the correct location.
*
@ -394,7 +390,6 @@ function assertDebugLine(dbg, line, column) {
ok(classMatch, "expression is highlighted as paused");
}
info(`Paused on line ${line}`);
}
/**
@ -1133,8 +1128,8 @@ const startKey = isMac
const keyMappings = {
close: { code: "w", modifiers: cmdOrCtrl },
commandKeyDown: { code: "VK_META", modifiers: { type: "keydown" } },
commandKeyUp: { code: "VK_META", modifiers: { type: "keyup" } },
commandKeyDown: {code: "VK_META", modifiers: {type: "keydown"}},
commandKeyUp: {code: "VK_META", modifiers: {type: "keyup"}},
debugger: { code: "s", modifiers: shiftOrAlt },
// test conditional panel shortcut
toggleCondPanel: { code: "b", modifiers: cmdShift },
@ -1449,8 +1444,8 @@ function clickElementWithSelector(dbg, selector) {
clickDOMElement(dbg, findElementWithSelector(dbg, selector));
}
function clickDOMElement(dbg, element, options = {}) {
EventUtils.synthesizeMouseAtCenter(element, options, dbg.win);
function clickDOMElement(dbg, element) {
EventUtils.synthesizeMouseAtCenter(element, {}, dbg.win);
}
function dblClickElement(dbg, elementName, ...args) {
@ -1496,11 +1491,6 @@ async function clickGutter(dbg, line) {
clickDOMElement(dbg, el);
}
async function cmdClickGutter(dbg, line) {
const el = await codeMirrorGutterElement(dbg, line);
clickDOMElement(dbg, el, cmdOrCtrl);
}
function findContextMenu(dbg, selector) {
// the context menu is in the toolbox window
const doc = dbg.toolbox.topDoc;