mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 20:11:38 +08:00
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in front_end and test/ Bug: 1319340 Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
60 lines
2.6 KiB
TypeScript
60 lines
2.6 KiB
TypeScript
// Copyright 2021 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import {assertNotNullOrUndefined, getTestServerPort, goToResource, waitForNone} from '../../shared/helper.js';
|
|
import {describe, it} from '../../shared/mocha-extensions.js';
|
|
import {
|
|
ensureResourceSectionIsExpanded,
|
|
expandIssue,
|
|
getIssueByTitle,
|
|
getResourcesElement,
|
|
ISSUE,
|
|
navigateToIssuesTab,
|
|
waitForTableFromResourceSectionContents,
|
|
} from '../helpers/issues-helpers.js';
|
|
|
|
describe('Cross-origin portal post message issue', async () => {
|
|
it('should display correct information', async () => {
|
|
await goToResource('issues/cross-origin-portal-post.html');
|
|
await navigateToIssuesTab();
|
|
await expandIssue();
|
|
const issueElement = await getIssueByTitle('Cross-origin portal post messages are blocked on your site');
|
|
assertNotNullOrUndefined(issueElement);
|
|
const section = await getResourcesElement('1 resource', issueElement);
|
|
await ensureResourceSectionIsExpanded(section);
|
|
const expectedTableRows = [
|
|
['Frame'],
|
|
[`https://localhost:${getTestServerPort()}/test/e2e/resources/issues/cross-origin-portal-post.html`],
|
|
];
|
|
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
|
|
});
|
|
|
|
it('should handle multiple issue correctly', async () => {
|
|
await goToResource('issues/cross-origin-portal-post-2.html');
|
|
await navigateToIssuesTab();
|
|
await expandIssue();
|
|
const issueElement = await getIssueByTitle('Cross-origin portal post messages are blocked on your site');
|
|
assertNotNullOrUndefined(issueElement);
|
|
const section = await getResourcesElement('2 resources', issueElement);
|
|
await ensureResourceSectionIsExpanded(section);
|
|
const expectedTableRows = [
|
|
['Frame'],
|
|
[`https://localhost:${getTestServerPort()}/test/e2e/resources/issues/cross-origin-portal-post-2.html`],
|
|
[`https://devtools.xorigin.test:${getTestServerPort()}/test/e2e/resources/issues/cross-origin-portal-post.html`],
|
|
];
|
|
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
|
|
});
|
|
|
|
it('should remove issue on update', async () => {
|
|
await goToResource('issues/cross-origin-portal-post.html');
|
|
await navigateToIssuesTab();
|
|
await expandIssue();
|
|
const issueElement = await getIssueByTitle('Cross-origin portal post messages are blocked on your site');
|
|
assertNotNullOrUndefined(issueElement);
|
|
await goToResource('issues/cross-origin-portal.html');
|
|
await navigateToIssuesTab();
|
|
await waitForNone(ISSUE);
|
|
});
|
|
});
|