"use strict";
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const helper_js_1 = require("../../shared/helper.js");
const console_helpers_js_1 = require("../helpers/console-helpers.js");
const settings_helpers_js_1 = require("../helpers/settings-helpers.js");
describe('Ignore list', () => {
    it('can be toggled on and off in console stack trace', async ({ devToolsPage, inspectedPage }) => {
        await (0, settings_helpers_js_1.setIgnoreListPattern)('thirdparty', devToolsPage);
        await inspectedPage.goToResource('../resources/sources/multi-files.html');
        await (0, console_helpers_js_1.navigateToConsoleTab)(devToolsPage);
        await inspectedPage.evaluate('wrapper(() => {console.trace("test");});');
        await devToolsPage.waitFor('.stack-preview-container:not(.show-hidden-rows)');
        await devToolsPage.waitForVisible('.show-all-link');
        const minimized = [
            '(anonymous) @ (index):1',
            '(anonymous) @ (index):1',
        ];
        const full = [
            '(anonymous) @ (index):1',
            'innercall @ multi-files-thirdparty.js:8',
            'callfunc @ multi-files-thirdparty.js:16',
            '(anonymous) @ (index):1',
        ];
        chai_1.assert.deepEqual((await devToolsPage.getVisibleTextContents('.stack-preview-container tbody tr'))
            .map((value) => value ? (0, helper_js_1.replacePuppeteerUrl)(value) : value), minimized);
        await devToolsPage.click('.show-all-link .link');
        await devToolsPage.waitFor('.stack-preview-container.show-hidden-rows');
        await devToolsPage.waitForVisible('.show-less-link');
        chai_1.assert.deepEqual((await devToolsPage.getVisibleTextContents('.stack-preview-container tbody tr'))
            .map((value) => value ? (0, helper_js_1.replacePuppeteerUrl)(value) : value), full);
        await devToolsPage.click('.show-less-link .link');
        await devToolsPage.waitFor('.stack-preview-container:not(.show-hidden-rows)');
        await devToolsPage.waitForVisible('.show-all-link');
        chai_1.assert.deepEqual((await devToolsPage.getVisibleTextContents('.stack-preview-container tbody tr'))
            .map((value) => value ? (0, helper_js_1.replacePuppeteerUrl)(value) : value), minimized);
    });
});
//# sourceMappingURL=console-ignore-list.test.js.map