"use strict";
// Copyright 2025 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 elements_helpers_js_1 = require("../helpers/elements-helpers.js");
describe('The Elements tab', () => {
    it('shows iframe content', async ({ devToolsPage, inspectedPage }) => {
        await inspectedPage.goToResource('elements/page-with-oopif.html', { waitUntil: 'networkidle0' });
        await (0, elements_helpers_js_1.expandSelectedNodeRecursively)(devToolsPage);
        async function expandIframeContent() {
            await (0, elements_helpers_js_1.waitForAndClickTreeElementWithPartialText)('#document', devToolsPage);
            // #document cannot be expanded. Using keyboard nav as a workaround.
            await devToolsPage.click('.selected[role="treeitem"]', { clickOptions: { count: 2 } });
            await devToolsPage.pressKey('ArrowDown');
            await devToolsPage.pressKey('ArrowDown');
            await devToolsPage.pressKey('ArrowDown');
            await (0, elements_helpers_js_1.expandSelectedNodeRecursively)(devToolsPage);
        }
        await expandIframeContent();
        // Part of the iframe URL.
        await (0, elements_helpers_js_1.waitForElementWithPartialText)('devtools.oopif.test', devToolsPage);
        // iframe content.
        await (0, elements_helpers_js_1.waitForElementWithPartialText)('Hello World', devToolsPage);
        // Navigate to a local frame.
        const frame = await inspectedPage.page.waitForFrame(frame => frame.url().includes('devtools.oopif.test'));
        await frame.goto(`${inspectedPage.getResourcesPath('127.0.0.1')}/empty.html`);
        await (0, elements_helpers_js_1.waitForStyleRule)('iframe', devToolsPage);
        await expandIframeContent();
        // Part of the iframe URL.
        await (0, elements_helpers_js_1.waitForElementWithPartialText)('127.0.0.1', devToolsPage);
        // iframe content.
        await (0, elements_helpers_js_1.waitForElementWithPartialText)('Hello World', devToolsPage);
    });
});
//# sourceMappingURL=oopif-navigation.test.js.map