#include <string_view>
#include "base/test/scoped_feature_list.h"
#include "content/browser/renderer_host/navigation_controller_impl.h"
#include "content/browser/renderer_host/navigation_request.h"
#include "content/browser/renderer_host/render_frame_host_manager_browsertest.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/content_navigation_policy.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_content_browser_client.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/content_mock_cert_verifier.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/test_frame_navigation_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/shell/browser/shell.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "content/test/render_document_feature.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/network/public/cpp/features.h"
namespace content {
namespace {
bool IsOriginOpaqueAndCompatibleWithURL(FrameTreeNode* node, const GURL& url) { … }
bool IsMainFrameOriginOpaqueAndCompatibleWithURL(Shell* shell,
const GURL& url) { … }
bool HasErrorPageSiteInfo(SiteInstance* site_instance) { … }
class BrowsingContextGroupSwapObserver : public WebContentsObserver { … };
}
class ProactivelySwapBrowsingInstancesTest : public RenderFrameHostManagerTest { … };
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesTest,
ErrorPageNavigationWithWindowOpenDoesNotChangeBrowsingInstance) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
ReloadShouldNotChangeBrowsingInstance) { … }
class ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest
: public RenderFrameHostManagerTest { … };
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
RendererInitiatedCrossSiteNavigationDoesNotReuseProcess) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
BrowserInitiatedCrossSiteNavigationDoesNotReuseProcess) { … }
class ProcessPerSiteContentBrowserClient
: public ContentBrowserTestContentBrowserClient { … };
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
RendererInitiatedCrossSiteNavigationToProcessPerSiteURLCreatesNewProcess) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
RendererInitiatedCrossSiteNavigationToProcessPerSiteURLUsesProcessForSite) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
NavigationToSiteThatRequiresDedicatedProcess) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesCrossSiteDoesNotReuseProcessTest,
NavigationFromSiteThatRequiresDedicatedProcess) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
RendererInitiatedSameSiteNavigationReusesProcess) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
BrowserInitiatedSameSiteNavigationReusesProcess) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
MultipleNavigationsStarted) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
HistoryNavigationReusesProcess) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
HistoryNavigationReusesProcess_SkipSameSiteEntry) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
HistoryNavigationReusesProcess_SkipCrossSiteEntry) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
HistoryNavigationReusesProcessThatIsStillAlive) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
SameEntryAndSameDocumentNavigationDoesNotSwap) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
ReloadDoesNotSwap) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
ReloadPostCommitErrorPage) { … }
class ProactivelySwapBrowsingInstancesTestWithoutSpeculativeRFHDelay
: public ProactivelySwapBrowsingInstancesTest { … };
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesTestWithoutSpeculativeRFHDelay,
SwapOnNavigationToPageThatRedirects) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
DoNotSwapWhenReplacingHistoryEntry) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesTest,
DISABLED_ShouldSwapWhenReplacingEntryWithSameDocumentPreviousEntry) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
DoNotSwapWhenRelatedContentsPresent) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
NavigationToSiteThatRequiresDedicatedProcess) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
PagehideRunsDuringCommit) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
VisibilitychangeRunsDuringCommit) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
DISABLED_UnloadRunsDuringCommit) { … }
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesTest,
PagehideAndVisibilitychangeInSubframesAreRunDuringCommit) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesTest,
PagehideRunsDuringCommitOfHiddenPage) { … }
class ProactivelySwapBrowsingInstancesOptOutTest
: public ProactivelySwapBrowsingInstancesTest { … };
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithAnchorRelOpener) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithWindowOpener) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithFormRelOpener) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
PreventingSwapAllowsFutureScripting) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
PreventingSwapAllowsFutureScriptingAfterAdditionalNav) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithAnchorRelOpenerCrossSite) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithAnchorRelOpenerWithParent) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithAnchorRelOpenerInOopif) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
DoNotSwapWithAnchorRelOpenerOpenURL) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
CannotOptOutOfCoop) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
CannotOptOutFromFencedFrame) { … }
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesOptOutTest,
RelOpenerAndNoopener) { … }
class ProactivelySwapBrowsingInstancesSameSiteCoopTest
: public ProactivelySwapBrowsingInstancesTest { … };
IN_PROC_BROWSER_TEST_P(ProactivelySwapBrowsingInstancesSameSiteCoopTest,
HistoryNavigationReusesProcess_COOP) { … }
class ProactivelySwapBrowsingInstancesSameSiteClearWindowNameTest
: public ProactivelySwapBrowsingInstancesTest { … };
IN_PROC_BROWSER_TEST_P(
ProactivelySwapBrowsingInstancesSameSiteClearWindowNameTest,
NotClearWindowNameSameSite) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}