Commit 17de7c41 authored by Eric Leese's avatar Eric Leese Committed by Commit Bot

Remove breakpoints-ui-restored-breakpoint test

This functionality is now being tested in the devtools e2e test suite.
Furthermore the existing test tests against incorrect behavior, so it
would block fixing the behavior in dev tools.

Bug: chromium:670180
Change-Id: I677de297f8494bbb334c0df58eebd493e9648fb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096590Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749166}
parent 5d0283f7
Tests breakpoint is restored.
Set different breakpoints and dump them
breakpoint at 5 disabled
breakpoint at 9
breakpoint at 10 conditional
Reload page and add script again and dump breakpoints
Page reloaded.
breakpoint at 5 disabled
breakpoint at 9
breakpoint at 10 conditional
Added two more iframes with script with the same url
Show uiSourceCode and dump breakpoints
breakpoint at 9
breakpoint at 10 conditional
Show uiSourceCode and dump breakpoints
breakpoint at 9
breakpoint at 10 conditional
Show uiSourceCode and dump breakpoints
breakpoint at 5 disabled
breakpoint at 9
breakpoint at 10 conditional
Reload page and add script again and dump breakpoints
Page reloaded.
breakpoint at 5 disabled
breakpoint at 9
breakpoint at 10 conditional
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult('Tests breakpoint is restored.');
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.addScriptTag('resources/a.js');
// Pairs of line number plus breakpoint decoration counts.
// We expect line 5, 9 and 10 to have decoration each.
const expectedDecorations = [[5, 1], [9, 1], [10, 1]];
let originalSourceFrame = await SourcesTestRunner.showScriptSourcePromise('a.js');
TestRunner.addResult('Set different breakpoints and dump them');
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(originalSourceFrame, expectedDecorations, async () => {
await SourcesTestRunner.toggleBreakpoint(originalSourceFrame, 9, false);
await SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 10, 'a === 3', true);
await SourcesTestRunner.createNewBreakpoint(originalSourceFrame, 5, '', false);
});
TestRunner.addResult('Reload page and add script again and dump breakpoints');
await TestRunner.reloadPagePromise();
await TestRunner.addScriptTag(TestRunner.url('resources/a.js'));
let sourceFrameAfterReload = await SourcesTestRunner.showScriptSourcePromise('a.js');
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrameAfterReload, expectedDecorations, () => {}, true);
// TODO(kozyatinskiy): as soon as we have script with the same url in different frames
// everything looks compeltely broken, we should fix it.
TestRunner.addResult('Added two more iframes with script with the same url');
TestRunner.addIframe(TestRunner.url('resources/frame-with-script.html'));
TestRunner.addIframe(TestRunner.url('resources/frame-with-script.html'));
const uiSourceCodes = await waitForNScriptSources('a.js', 3);
// The disabled breakpoint at line 5 is currently not included in the iframes that are added.
const expectedDecorationsArray = [[[9, 1], [10, 1]], [[9, 1], [10, 1]], expectedDecorations];
let index = 0;
for (const uiSourceCode of uiSourceCodes) {
TestRunner.addResult('Show uiSourceCode and dump breakpoints');
const sourceFrame = await SourcesTestRunner.showUISourceCodePromise(uiSourceCode);
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrame, expectedDecorationsArray[index++], () => {}, true);
}
TestRunner.addResult('Reload page and add script again and dump breakpoints');
await TestRunner.reloadPagePromise();
await TestRunner.addScriptTag(TestRunner.url('resources/a.js'));
sourceFrameAfterReload = await SourcesTestRunner.showScriptSourcePromise('a.js');
await SourcesTestRunner.runActionAndWaitForExactBreakpointDecorations(
sourceFrameAfterReload, expectedDecorations, () => {}, true);
TestRunner.completeTest();
async function waitForNScriptSources(scriptName, N) {
while (true) {
let uiSourceCodes = UI.panels.sources._workspace.uiSourceCodes();
uiSourceCodes = uiSourceCodes.filter(uiSourceCode => uiSourceCode.project().type() !== Workspace.projectTypes.Service && uiSourceCode.name() === scriptName);
if (uiSourceCodes.length === N)
return uiSourceCodes;
await TestRunner.addSnifferPromise(Sources.SourcesView.prototype, '_addUISourceCode');
}
}
})();
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