|
| 1 | +// Copyright 2023 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 | + navigateToConsoleTab, |
| 9 | +} from '../../e2e/helpers/console-helpers.js'; |
| 10 | +import {setIgnoreListPattern} from '../../e2e/helpers/settings-helpers.js'; |
| 11 | +import { |
| 12 | + getVisibleTextContents, |
| 13 | + replacePuppeteerUrl, |
| 14 | +} from '../../shared/helper.js'; |
| 15 | + |
| 16 | +describe('Ignore list', () => { |
| 17 | + it('can be toggled on and off in console stack trace', async ({devToolsPage, inspectedPage}) => { |
| 18 | + await setIgnoreListPattern('thirdparty', devToolsPage); |
| 19 | + |
| 20 | + await inspectedPage.goToResource('../resources/sources/multi-files.html'); |
| 21 | + await navigateToConsoleTab(devToolsPage); |
| 22 | + await inspectedPage.evaluate('wrapper(() => {console.trace("test");});'); |
| 23 | + |
| 24 | + await devToolsPage.waitFor('.stack-preview-container:not(.show-hidden-rows)'); |
| 25 | + await devToolsPage.waitForVisible('.show-all-link'); |
| 26 | + |
| 27 | + const minimized = [ |
| 28 | + '(anonymous) @ (index):1', |
| 29 | + '(anonymous) @ (index):1', |
| 30 | + ]; |
| 31 | + const full = [ |
| 32 | + '(anonymous) @ (index):1', |
| 33 | + 'innercall @ multi-files-thirdparty.js:8', |
| 34 | + 'callfunc @ multi-files-thirdparty.js:16', |
| 35 | + '(anonymous) @ (index):1', |
| 36 | + ]; |
| 37 | + |
| 38 | + assert.deepEqual( |
| 39 | + (await getVisibleTextContents('.stack-preview-container tbody tr', devToolsPage)) |
| 40 | + .map((value: string|null) => value ? replacePuppeteerUrl(value) : value), |
| 41 | + minimized); |
| 42 | + |
| 43 | + await devToolsPage.click('.show-all-link .link'); |
| 44 | + await devToolsPage.waitFor('.stack-preview-container.show-hidden-rows'); |
| 45 | + await devToolsPage.waitForVisible('.show-less-link'); |
| 46 | + |
| 47 | + assert.deepEqual( |
| 48 | + (await getVisibleTextContents('.stack-preview-container tbody tr', devToolsPage)) |
| 49 | + .map((value: string|null) => value ? replacePuppeteerUrl(value) : value), |
| 50 | + full); |
| 51 | + |
| 52 | + await devToolsPage.click('.show-less-link .link'); |
| 53 | + await devToolsPage.waitFor('.stack-preview-container:not(.show-hidden-rows)'); |
| 54 | + await devToolsPage.waitForVisible('.show-all-link'); |
| 55 | + |
| 56 | + assert.deepEqual( |
| 57 | + (await getVisibleTextContents('.stack-preview-container tbody tr', devToolsPage)) |
| 58 | + .map((value: string|null) => value ? replacePuppeteerUrl(value) : value), |
| 59 | + minimized); |
| 60 | + }); |
| 61 | +}); |
0 commit comments