Skip to content

Commit 740367c

Browse files
szuendDevtools-frontend LUCI CQ
authored andcommitted
Migrate inline-variable_test.ts to e2e_non_hosted
Fixed: 416404755 Change-Id: Id330128f9881305d93575e2500db790fe9da744e Bug: 416404755 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6712995 Auto-Submit: Simon Zünd <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 54db639 commit 740367c

File tree

4 files changed

+37
-35
lines changed

4 files changed

+37
-35
lines changed

test/e2e/sources/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ node_ts_library("sources") {
1616
"header-overrides_test.ts",
1717
"icon-row-bucket_test.ts",
1818
"ignore-list_test.ts",
19-
"inline-variable_test.ts",
2019
"live-edit-moving-breakpoint_test.ts",
2120
"navigator-view_test.ts",
2221
"overrides_test.ts",

test/e2e/sources/inline-variable_test.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

test/e2e_non_hosted/sources/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ts_e2e_library("sources") {
1717
"icon-row-bucket_test.ts",
1818
"inline-breakpoint_test.ts",
1919
"inline-scripts_test.ts",
20+
"inline-variable_test.ts",
2021
"link-to-correct-source-line_test.ts",
2122
"pause-button_test.ts",
2223
"popover_test.ts",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2022 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import {assert} from 'chai';
6+
7+
import {
8+
addBreakpointForLine,
9+
openSourceCodeEditorForFile,
10+
RESUME_BUTTON,
11+
} from '../../e2e/helpers/sources-helpers.js';
12+
import type {DevToolsPage} from '../../e2e_non_hosted/shared/frontend-helper.js';
13+
14+
async function retrieveCodeMirrorEditorContent(devToolsPage: DevToolsPage): Promise<string[]> {
15+
const editor = await devToolsPage.waitFor('[aria-label="Code editor"]');
16+
return await editor.evaluate(
17+
(node: Element) => [...node.querySelectorAll('.cm-line')].map(node => node.textContent || '') || []);
18+
}
19+
20+
describe('Sources Tab', function() {
21+
it('shows correct inline variable at definition', async ({devToolsPage, inspectedPage}) => {
22+
await openSourceCodeEditorForFile('inline-variable.js', 'inline-variable.html', devToolsPage, inspectedPage);
23+
await addBreakpointForLine(3, devToolsPage);
24+
25+
const scriptEvaluation = inspectedPage.evaluate('simple(41);');
26+
27+
await devToolsPage.waitFor('.cm-line > .cm-variableValues');
28+
29+
const contents = await retrieveCodeMirrorEditorContent(devToolsPage);
30+
assert.strictEqual(contents[0], 'function simple(a) {a = 41');
31+
assert.strictEqual(contents[1], ' let x = a + 1;x = 42');
32+
33+
await devToolsPage.click(RESUME_BUTTON);
34+
await scriptEvaluation;
35+
});
36+
});

0 commit comments

Comments
 (0)