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

Prepare breakpoint web tests for source map asyncification (2/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.

R=sigurds@chromium.org

Bug: chromium:1032016
Change-Id: I1002384ffa6bbc330cd3132c183e356e5b1f59ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029368
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: default avatarSigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737235}
parent 122b074f
......@@ -9,37 +9,43 @@
await TestRunner.navigate(TestRunner.url('resources/a.html'));
// Pairs of line number plus breakpoint decoration counts.
// We expect line 3 to have 2 decorations and line 5 to have one decoration and so on.
const expectedDecorationsHtml = [[3, 2], [5, 1], [6, 1]];
const expectedDecorationsJs = [[5, 1], [9, 1], [10, 1]];
let sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.html');
TestRunner.addResult('Set different breakpoints in inline script and dump them');
SourcesTestRunner.toggleBreakpoint(sourceFrame, 3, false);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, 'a === 3', true);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 6, '', false);
await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame);
SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(sourceFrame, expectedDecorationsHtml, async () => {
await SourcesTestRunner.toggleBreakpoint(sourceFrame, 3, false);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, 'a === 3', true);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 6, '', false);
});
sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.js');
TestRunner.addResult('Set different breakpoints and dump them');
SourcesTestRunner.toggleBreakpoint(sourceFrame, 9, false);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, 'a === 3', true);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, '', false);
await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame);
SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(sourceFrame, expectedDecorationsJs, async () => {
await SourcesTestRunner.toggleBreakpoint(sourceFrame, 9, false);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 10, 'a === 3', true);
await SourcesTestRunner.createNewBreakpoint(sourceFrame, 5, '', false);
});
TestRunner.addResult('Dump to b.html and check that there is no breakpoints');
await TestRunner.navigate(TestRunner.url('resources/b.html'));
sourceFrame = await SourcesTestRunner.showScriptSourcePromise('b.html');
SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrame, [], () => {}, true);
TestRunner.addResult('Navigate back to a.html and dump breakpoints');
await TestRunner.navigate(TestRunner.url('resources/a.html'));
TestRunner.addResult('a.html:');
sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.html');
await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame);
SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrame, expectedDecorationsHtml, () => {}, true);
TestRunner.addResult('a.js:');
sourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.js');
await SourcesTestRunner.waitDebuggerPluginBreakpoints(sourceFrame);
SourcesTestRunner.dumpDebuggerPluginBreakpoints(sourceFrame);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrame, expectedDecorationsJs, () => {}, true);
TestRunner.completeTest();
})();
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