Commit bff8b124 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

Reland "Prepare breakpoint web tests for source map asyncification (4/5)"

This is a reland of 459e299a

The reland rewrites the "addBreakpoint" function in the
"testTwoBreakpointsResolvedInOneLine" test case by using the new
de-flaked helper for both breakpoints (that are on the same line).

Unfortunately, between revert and reland a change to depot_tools requires
JavaScript to be formatted now, so the reland contains lots of
formatting changes compared to the original CL.

Original change's description:
> Prepare breakpoint web tests for source map asyncification (4/5)
>
> This CL re-writes a breakpoint web test using a new SourcesTestRunner
> helper introduced in https://crrev.com/c/2027427.
>
> This should not only prepare the test for the upcoming source map
> asyncification but also reduce the overall flakiness of breakpoint
> web tests.
>
> This CL superseeds the current in-flight CL https://crrev.com/c/2022642
> which will be abandoned.
>
> R=sigurds@chromium.org
>
> Bug: chromium:1032016
> Change-Id: Id5bcd9d3913a2f83c029f52da33e484c61f0c9db
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2030464
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#737714}

Bug: chromium:1032016
Change-Id: Ibed68e7b8c8494cd3cc6ea0d744ec9c42f7acb5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035375
Auto-Submit: Simon Zünd <szuend@chromium.org>
Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738097}
parent 19d94ea9
......@@ -10,6 +10,9 @@ Toggle breakpoint
Running: testTwoBreakpointsResolvedInOneLine
Setting breakpoint
breakpoint at 2
inline breakpoint at (2, 4)
inline breakpoint at (2, 13) disabled
breakpoint at 2 conditional
inline breakpoint at (2, 4)
inline breakpoint at (2, 13) disabled
......@@ -25,11 +28,13 @@ breakpoint at 2
inline breakpoint at (2, 4)
inline breakpoint at (2, 13) disabled
Adding conditional enabled breakpoint
breakpoint at 2
breakpoint at 2 conditional
inline breakpoint at (2, 4)
inline breakpoint at (2, 13) disabled
Disable breakpoints
breakpoint at 2 disabled
breakpoint at 2 disabled conditional
inline breakpoint at (2, 4) disabled
inline breakpoint at (2, 13) disabled
Enable breakpoints
breakpoint at 2 conditional
inline breakpoint at (2, 4)
......
......@@ -8,11 +8,6 @@
await TestRunner.showPanel('sources');
await TestRunner.addScriptTag('resources/edit-me-breakpoints.js');
function waitAndDumpDecorations(sourceFrame) {
return SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame).then(
() => SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame));
}
Bindings.breakpointManager._storage._breakpoints = new Map();
SourcesTestRunner.runDebuggerTestSuite([
function testAddRemoveBreakpoint(next) {
......@@ -22,15 +17,24 @@
function addBreakpoint(sourceFrame) {
javaScriptSourceFrame = sourceFrame;
TestRunner.addResult('Setting breakpoint');
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, '', true)
.then(() => waitAndDumpDecorations(javaScriptSourceFrame))
// Breakpoint decoration expectations are pairs of line number plus
// breakpoint decoration counts. We expect line 2 to have 2 decorations.
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, '', true))
.then(removeBreakpoint);
}
function removeBreakpoint() {
TestRunner.addResult('Toggle breakpoint');
SourcesTestRunner.toggleBreakpoint(javaScriptSourceFrame, 2);
waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [],
() => SourcesTestRunner.toggleBreakpoint(
javaScriptSourceFrame, 2))
.then(next);
}
},
......@@ -38,20 +42,28 @@
var javaScriptSourceFrame;
SourcesTestRunner.showScriptSource('edit-me-breakpoints.js', addBreakpoint);
function addBreakpoint(sourceFrame) {
async function addBreakpoint(sourceFrame) {
javaScriptSourceFrame = sourceFrame;
TestRunner.addResult('Setting breakpoint');
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, '', true)
.then(() => SourcesTestRunner.waitBreakpointSidebarPane(true))
.then(() => SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, 'true', true))
.then(() => waitAndDumpDecorations(javaScriptSourceFrame))
.then(removeBreakpoint);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, '', true));
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, 'true', true));
removeBreakpoint();
}
function removeBreakpoint() {
TestRunner.addResult('Toggle breakpoint');
SourcesTestRunner.toggleBreakpoint(javaScriptSourceFrame, 2);
waitAndDumpDecorations(javaScriptSourceFrame).then(() => next());
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [],
() => SourcesTestRunner.toggleBreakpoint(
javaScriptSourceFrame, 2))
.then(next);
}
},
......@@ -62,44 +74,72 @@
function addRegularDisabled(sourceFrame) {
javaScriptSourceFrame = sourceFrame;
TestRunner.addResult('Adding regular disabled breakpoint');
waitAndDumpDecorations(javaScriptSourceFrame).then(addConditionalDisabled);
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, '', false);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 1]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, '', false))
.then(addConditionalDisabled);
}
function addConditionalDisabled() {
TestRunner.addResult('Adding conditional disabled breakpoint');
waitAndDumpDecorations(javaScriptSourceFrame).then(addRegularEnabled);
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, 'true', false);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 1]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, 'true', false))
.then(addRegularEnabled);
}
function addRegularEnabled() {
TestRunner.addResult('Adding regular enabled breakpoint');
waitAndDumpDecorations(javaScriptSourceFrame).then(addConditionalEnabled);
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, '', true);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, '', true))
.then(addConditionalEnabled);
}
function addConditionalEnabled() {
TestRunner.addResult('Adding conditional enabled breakpoint');
waitAndDumpDecorations(javaScriptSourceFrame).then(disableAll);
SourcesTestRunner.createNewBreakpoint(javaScriptSourceFrame, 2, 'true', true);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.createNewBreakpoint(
javaScriptSourceFrame, 2, 'true', true))
.then(disableAll);
}
function disableAll() {
TestRunner.addResult('Disable breakpoints');
waitAndDumpDecorations(javaScriptSourceFrame).then(enabledAll);
SourcesTestRunner.toggleBreakpoint(javaScriptSourceFrame, 2, true);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.toggleBreakpoint(
javaScriptSourceFrame, 2, true))
.then(enabledAll);
}
function enabledAll() {
TestRunner.addResult('Enable breakpoints');
waitAndDumpDecorations(javaScriptSourceFrame).then(removeAll);
SourcesTestRunner.toggleBreakpoint(javaScriptSourceFrame, 2, true);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [[2, 2]],
() => SourcesTestRunner.toggleBreakpoint(
javaScriptSourceFrame, 2, true))
.then(removeAll);
}
function removeAll() {
TestRunner.addResult('Remove breakpoints');
waitAndDumpDecorations(javaScriptSourceFrame).then(next);
SourcesTestRunner.toggleBreakpoint(javaScriptSourceFrame, 2, false);
SourcesTestRunner
.runActionAndWaitForExactBreakpointDecorations(
javaScriptSourceFrame, [],
() => SourcesTestRunner.toggleBreakpoint(
javaScriptSourceFrame, 2, false))
.then(next);
}
}
]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment