"use strict";
// Copyright 2022 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 sources_helpers_js_1 = require("../helpers/sources-helpers.js");
describe('Snippets subpane', () => {
    it('can stop on breakpoints', async ({ devToolsPage }) => {
        const snippetName = 'Script snippet #7';
        await (0, sources_helpers_js_1.openSourcesPanel)(devToolsPage);
        await (0, sources_helpers_js_1.openSnippetsSubPane)(devToolsPage);
        await (0, sources_helpers_js_1.createNewSnippet)(snippetName, 'console.log(1);\nconsole.log(2);\nconsole.log(3);\n', devToolsPage);
        chai_1.assert.deepEqual(await (0, sources_helpers_js_1.getOpenSources)(devToolsPage), [snippetName]);
        await (0, sources_helpers_js_1.addBreakpointForLine)(2, devToolsPage);
        let decorators = await (0, sources_helpers_js_1.getBreakpointDecorators)(false, 1, devToolsPage);
        chai_1.assert.deepEqual(decorators, [2]);
        await devToolsPage.click('[aria-label="Run snippet"]');
        // We stop on the breakpoint
        await devToolsPage.waitFor(sources_helpers_js_1.RESUME_BUTTON);
        await (0, sources_helpers_js_1.executionLineHighlighted)(devToolsPage);
        // The breakpoint is still visible
        decorators = await (0, sources_helpers_js_1.getBreakpointDecorators)(false, 1, devToolsPage);
        chai_1.assert.deepEqual(decorators, [2]);
        chai_1.assert.deepEqual(await (0, sources_helpers_js_1.getOpenSources)(devToolsPage), [snippetName]);
        await devToolsPage.click(sources_helpers_js_1.RESUME_BUTTON);
        await devToolsPage.waitFor(sources_helpers_js_1.PAUSE_BUTTON);
    });
});
//# sourceMappingURL=breakpoint.test.js.map