#include <cstdint>
#include <optional>
#include <tuple>
#include "base/barrier_closure.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/memory_pressure_monitor.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/metrics_hashes.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/run_until.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/test/test_timeouts.h"
#include "base/thread_annotations.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "cc/base/features.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "components/services/storage/public/mojom/storage_service.mojom.h"
#include "components/services/storage/public/mojom/test_api.test-mojom.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/browser/back_forward_cache_test_util.h"
#include "content/browser/preloading/prefetch/prefetch_features.h"
#include "content/browser/preloading/prefetch/prefetch_service.h"
#include "content/browser/preloading/prefetch/prefetch_test_util_internal.h"
#include "content/browser/preloading/preloading.h"
#include "content/browser/preloading/preloading_attempt_impl.h"
#include "content/browser/preloading/preloading_data_impl.h"
#include "content/browser/preloading/preloading_decider.h"
#include "content/browser/preloading/prerender/prerender_features.h"
#include "content/browser/preloading/prerender/prerender_final_status.h"
#include "content/browser/preloading/prerender/prerender_host.h"
#include "content/browser/preloading/prerender/prerender_host_registry.h"
#include "content/browser/preloading/prerender/prerender_metrics.h"
#include "content/browser/preloading/prerender/prerender_no_vary_search_hint_commit_deferring_condition.h"
#include "content/browser/renderer_host/back_forward_cache_impl.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/navigation_request.h"
#include "content/browser/renderer_host/navigation_type.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/content_navigation_policy.h"
#include "content/common/features.h"
#include "content/common/input/synthetic_tap_gesture.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/disallow_activation_reason.h"
#include "content/public/browser/document_user_data.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/prerender_web_contents_delegate.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/isolated_world_ids.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/background_color_change_waiter.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/browsing_data_remover_test_util.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/file_system_chooser_test_helpers.h"
#include "content/public/test/mock_client_hints_controller_delegate.h"
#include "content/public/test/mock_web_contents_observer.h"
#include "content/public/test/mojo_capability_control_test_interfaces.mojom.h"
#include "content/public/test/mojo_capability_control_test_util.h"
#include "content/public/test/navigation_handle_observer.h"
#include "content/public/test/no_renderer_crashes_assertion.h"
#include "content/public/test/preloading_test_util.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/scoped_accessibility_mode_override.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_navigation_throttle.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/theme_change_waiter.h"
#include "content/public/test/url_loader_interceptor.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_browser_context.h"
#include "content/test/content_browser_test_utils_internal.h"
#include "content/test/mock_commit_deferring_condition.h"
#include "content/test/render_document_feature.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "mojo/public/cpp/system/functions.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/loader_constants.h"
#include "third_party/blink/public/mojom/browser_interface_broker.mojom.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include "third_party/blink/public/mojom/page/display_cutout.mojom.h"
#include "ui/events/base_event_utils.h"
#include "ui/shell_dialogs/select_file_dialog.h"
#include "ui/shell_dialogs/select_file_dialog_factory.h"
#include "url/gurl.h"
#include "url/url_constants.h"
#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/common/pepper_plugin.mojom.h"
#endif
Exactly;
namespace content {
namespace …
IN_PROC_BROWSER_TEST_F(
NoVarySearchPrerenderBrowserTest,
EagerTimerWorksCorrectlyForHeadersThatArriveBeforeTimeout) { … }
IN_PROC_BROWSER_TEST_F(
NoVarySearchPrerenderBrowserTest,
EagerTimerWorksCorrectlyForHeadersThatArriveAfterTimeout) { … }
void NoVarySearchPrerenderBrowserTest::TestNoVarySearchHeaderFailure(
const std::string& no_vary_search_header,
FinishedReason expected_finished_reason) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
MalformedNoVarySearchHeader) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
NoVarySearchHeaderWithDefaultValue) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest, NoNoVarySearchHeader) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
UnmatchedNoVarySearchHeader) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
HintActivationSuccessful) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
HintActivationUnsuccessful) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
HintActivationSuccessful_ExactUrl) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
MultipleMatchableHosts) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest, HintIsPopulated) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest, ExactUrlMatch) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest, InexactUrlMatch) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
ExactMatchWithUrlRedirection) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
InexactMatchWithUrlRedirection) { … }
IN_PROC_BROWSER_TEST_F(DisabledNoVarySearchPrerenderBrowserTest,
NoVarySearchHintIsNotPopulated) { … }
IN_PROC_BROWSER_TEST_F(NoVarySearchPrerenderBrowserTest,
InexactUrlMatchWithMainFrameNavigation) { … }
IN_PROC_BROWSER_TEST_F(DisabledNoVarySearchPrerenderBrowserTest,
NoVarySearchHintActivationUnsuccessful) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SpeculationRulesPrerender) { … }
class PrerenderTargetAgnosticBrowserTest
: public PrerenderBrowserTest,
public testing::WithParamInterface<std::string> { … };
INSTANTIATE_TEST_SUITE_P(All,
PrerenderTargetAgnosticBrowserTest,
testing::Values("_self", "_blank"),
[](const testing::TestParamInfo<std::string>& info) { … };
class AutoSpeculationRulesPrerenderBrowserTest : public PrerenderBrowserTest { … };
class AutoSpeculationRulesPrerenderBrowserTestWithHoldback
: public AutoSpeculationRulesPrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AutoSpeculationRulesPrerenderBrowserTest, Metrics) { … }
IN_PROC_BROWSER_TEST_F(AutoSpeculationRulesPrerenderBrowserTestWithHoldback,
Metrics) { … }
enum class PrerenderingResult { … };
enum class BodySize { … };
class PrerenderAndPrefetchBrowserTest
: public PrerenderBrowserTest,
public testing::WithParamInterface<
std::tuple<PrerenderingResult, BodySize, PrefetchReusableForTests>> { … };
IN_PROC_BROWSER_TEST_P(PrerenderAndPrefetchBrowserTest,
SpeculationRulesPrefetchThenPrerender) { … }
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SpeculationInitiatorNavigateAway) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ActivateOnLinkClick) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ActivateOnLinkClick_TargetBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
ActivateOnLinkClick_TargetBlank_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
BackgroundedPage_ActivateOnLinkClick_TargetBlank_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
BackgroundedPageTimeout_TargetBlank_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
PrerenderWhenInitiatorInBackground_Queue_Processing_WithTargetHint) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
ActivateOnLinkClick_TargetBlankWithNoopener) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
ActivateOnLinkClick_TargetBlankWithNoopener_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
ActivateOnLinkClick_TargetBlankWithOpener) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
ActivateOnLinkClick_TargetBlankWithOpener_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ActivateOnWindowOpen) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ResponseHeaders) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NewTabPrerenderCancellationOnInitiatorPHR) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NewTabPrerenderCancellationOnNewTabPHR) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NewTabPrerenderCancellationByInitiatorWCClosure) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PrerenderCancelledOnEmptyBody404) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PrerenderCancelledOnNonEmptyBody404) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PrerenderCancelledOn500Page) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PrerenderCancelledOn204Page) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PrerenderCancelledOn205Page) { … }
namespace {
void PrerenderBrowserTest::TestPrerenderAllowedOnIframeWithStatusCode(
OriginType origin_type,
std::string status_code) { … }
}
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_204_SameOrigin) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_204_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_204_CrossSite) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_205_SameOrigin) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_205_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderAllowedOnIframe_205_CrossSite) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CancelOnAuthRequested) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CancelOnAuthRequestedSubframe) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CancelOnAuthRequestedSubResource) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelOnSpeculationCandidateRemoved) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
CancelOnSpeculationCandidateRemoved_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DontCancelOnSpeculationUpdateIfStillEligible) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CanStartSecondPrerenderWhenCancellingFirst) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, RetriggerPrerenderAfterRemoval) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderChain) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, IgnoreSubFrameInitiatedPrerender) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CloseOnPrerendering) { … }
namespace {
class RedirectChainObserver : public WebContentsObserver { … };
}
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SameOriginRedirection) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CrossSiteRedirection) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, Activation_iFrame) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SessionHistoryShouldHaveSingleNavigationEntryInPrerender) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SessionHistoryAfterActivation) { … }
class PrerenderOopsifBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderOopsifBrowserTest,
OopsifSrcdocSandboxIframeWithPostmessage) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DeferCrossOriginSubframeNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DeferCrossOriginRedirectsOnSubframeNavigation) { … }
class PrerenderMainFrameNavigationBrowserTest
: public testing::WithParamInterface<PreloadingTriggerType>,
public PrerenderBrowserTest { … };
INSTANTIATE_TEST_SUITE_P(
All,
PrerenderMainFrameNavigationBrowserTest,
testing::Values(PreloadingTriggerType::kSpeculationRule,
PreloadingTriggerType::kSpeculationRuleFromIsolatedWorld,
PreloadingTriggerType::kEmbedder),
[](const testing::TestParamInfo<PreloadingTriggerType>& info) { … };
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest, SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest, CrossSite) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOriginWithOptIn_SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOriginWithOptIn_SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOriginWithOptIn_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
SameSiteCrossOrigin_CrossSite) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_CrossSite) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_CrossSite) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOriginWithOptIn_SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOriginWithOptIn_SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOriginWithOptIn_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameOrigin_SameSiteCrossOriginWithOptIn_CrossSite) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameOrigin_SameOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameOrigin_SameSiteCrossOriginWithOptIn) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameOrigin_SameSiteCrossOrigin) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderMainFrameNavigationBrowserTest,
Redirection_SameSiteCrossOriginWithOptIn_SameOrigin_CrossSite) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MainFrameNavigation_NonHttpUrl) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MainFrameFragmentNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, Activation_PopUpWindow) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, Activation_PageWithPopUpWindow) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderIframe) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderBlankIframe) { … }
PrerenderBrowserDeathTest;
IN_PROC_BROWSER_TEST_F(PrerenderBrowserDeathTest,
PrerenderCannotHaveInnerContents) { … }
class IsActivationObserver : public WebContentsObserver { … };
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NavigationRequestIsPrerenderedPageActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ActivationDoesntRunThrottles) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest, SuppressOpenURL) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ForEachRenderFrameHost) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, TabVisibleURL) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, CancelOnPreferredSizeChanged) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, NoPopupWidget) { … }
class TestPrerenderCancellerSubframeNavigationThrottle
: public NavigationThrottle { … };
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SubframeNavigationWhilePrerenderHostIsBeingDestroyed) { … }
class MojoCapabilityControlTestContentBrowserClient
: public ContentBrowserTestContentBrowserClient,
public test::MojoCapabilityControlTestHelper { … };
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MojoCapabilityControl) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MojoCapabilityControl_CancelMainFrame) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MojoCapabilityControl_CancelIframe) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MojoCapabilityControl_HandleUnexpected) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MojoCapabilityControl_LoosenMode) { … }
void PrerenderBrowserTest::TestCancelPrerendersWhenTimeout(
std::vector<Visibility> visibility_transitions) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerendersWhenTimeout_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerendersWhenTimeout_Occluded) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerendersWhenTimeout_OccludedHidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerendersWhenTimeout_OccludedVisibleHidden) { … }
void PrerenderBrowserTest::TestCancelOnlyEmbedderTriggeredPrerenderWhenTimeout(
std::vector<Visibility> visibility_transitions) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelOnlyEmbedderTriggeredPrerenderWhenTimeout_Hidden) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
CancelOnlyEmbedderTriggeredPrerenderWhenTimeout_Occluded) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
CancelOnlyEmbedderTriggeredPrerenderWhenTimeout_OccludedHidden) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
CancelOnlyEmbedderTriggeredPrerenderWhenTimeout_OccludedVisibleHidden) { … }
void PrerenderBrowserTest::TestTimerResetWhenPageGoBackToForeground(
Visibility visibility) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
TimerResetWhenPageGoBackToForeground_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
TimerResetWhenPageGoBackToForeground_Occluded) { … }
void PrerenderBrowserTest::TestCancelPrerenderWithTargetBlankWhenTimeout(
Visibility visibility) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerenderWithTargetBlankWhenTimeout_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerenderWithTargetBlankWhenTimeout_Occluded) { … }
enum class SSLPrerenderTestErrorBlockType { … };
std::string SSLPrerenderTestErrorBlockTypeToString(
const testing::TestParamInfo<SSLPrerenderTestErrorBlockType>& info) { … }
class SSLPrerenderBrowserTest
: public testing::WithParamInterface<SSLPrerenderTestErrorBlockType>,
public PrerenderBrowserTest { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(SSLPrerenderBrowserTest,
CertificateValidation_Navigation) { … }
IN_PROC_BROWSER_TEST_P(SSLPrerenderBrowserTest,
CertificateValidation_Subresource) { … }
IN_PROC_BROWSER_TEST_P(SSLPrerenderBrowserTest,
CertificateValidation_SWMainResource) { … }
IN_PROC_BROWSER_TEST_P(SSLPrerenderBrowserTest,
CertificateValidation_SWSubResource) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, FeatureRestriction_WindowOpen) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
RenderFrameHostLifecycleState) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SupportActivationWithOngoingMainFrameNavigation) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DeferPrivateOriginFileSystem …
#else
#define MAYBE_DeferPrivateOriginFileSystem …
#endif
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MAYBE_DeferPrivateOriginFileSystem) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DocumentUserData) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, GamepadMonitorCancelPrerendering) { … }
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, GamepadMonitorAfterNavigation) { … }
#endif
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ClipboardByExecCommandFail) { … }
void LoadAndWaitForPrerenderDestroyed(test::PrerenderTestHelper* helper,
const GURL prerendering_url,
const std::string& target_hint) { … }
#if BUILDFLAG(ENABLE_PPAPI)
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
PluginsCancelPrerendering) {
const GURL kInitialUrl = GetUrl("/empty.html");
ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl));
LoadAndWaitForPrerenderDestroyed(
prerender_helper(), GetUrl("/prerender/page-with-embedded-plugin.html"),
GetTargetHint());
ExpectFinalStatusForSpeculationRule(PrerenderFinalStatus::kMojoBinderPolicy);
histogram_tester().ExpectUniqueSample(
"Prerender.Experimental.PrerenderCancelledInterface.SpeculationRule",
PrerenderCancelledInterface::kUnknown, 1);
histogram_tester().ExpectUniqueSample(
"Prerender.Experimental.PrerenderCancelledUnknownInterface."
"SpeculationRule",
InterfaceNameHasher(mojom::PepperHost::Name_), 1);
LoadAndWaitForPrerenderDestroyed(
prerender_helper(), GetUrl("/prerender/page-with-object-plugin.html"),
GetTargetHint());
histogram_tester().ExpectUniqueSample(
"Prerender.Experimental.PrerenderHostFinalStatus.SpeculationRule",
PrerenderFinalStatus::kMojoBinderPolicy, 2);
histogram_tester().ExpectUniqueSample(
"Prerender.Experimental.PrerenderCancelledInterface.SpeculationRule",
PrerenderCancelledInterface::kUnknown, 2);
histogram_tester().ExpectUniqueSample(
"Prerender.Experimental.PrerenderCancelledUnknownInterface."
"SpeculationRule",
InterfaceNameHasher(mojom::PepperHost::Name_), 2);
RenderFrameHostImpl* main_frame_host = current_frame_host();
EXPECT_TRUE(AddTestUtilJS(main_frame_host));
EXPECT_TRUE(ExecJs(main_frame_host, "add_iframe_async('/title1.html')",
EvalJsOptions::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES));
WaitForRequest(GetUrl("/title1.html"), 1);
}
#endif
#if BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, NotificationConstructorAndroid) {
const GURL kInitialUrl = GetUrl("/empty.html");
const GURL kPrerenderingUrl = GetUrl("/empty.html?prerender");
ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl));
int host_id = AddPrerender(kPrerenderingUrl);
auto* prerender_render_frame_host = GetPrerenderedMainFrameHost(host_id);
EXPECT_EQ(false, EvalJs(prerender_render_frame_host, R"(
(() => {
try { new Notification('My Notification'); return true;
} catch(e) { return false; }
})();
)"));
}
#endif
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest, DownloadByScript) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest,
DownloadInMainFrame) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest, DownloadInSubframe) { … }
#if BUILDFLAG(IS_ANDROID)
namespace {
class TestViewportWebContentsObserver : public WebContentsObserver {
public:
TestViewportWebContentsObserver(WebContents* web_contents,
blink::mojom::ViewportFit wanted_value)
: WebContentsObserver(web_contents), wanted_value_(wanted_value) {}
TestViewportWebContentsObserver(const TestViewportWebContentsObserver&) =
delete;
TestViewportWebContentsObserver& operator=(
const TestViewportWebContentsObserver&) = delete;
void ViewportFitChanged(blink::mojom::ViewportFit value) override {
value_ = value;
if (waiting_for_wanted_value_ && value == wanted_value_) {
std::move(waiting_for_wanted_value_).Run();
}
}
void WaitForWantedValue() {
if (value_.has_value() && value_.value() == wanted_value_) {
return;
}
base::RunLoop loop;
waiting_for_wanted_value_ = loop.QuitClosure();
loop.Run();
}
private:
base::OnceClosure waiting_for_wanted_value_;
std::optional<blink::mojom::ViewportFit> value_;
const blink::mojom::ViewportFit wanted_value_;
};
}
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ViewportFit) {
const GURL kInitialUrl = GetUrl("/prerender/viewport.html");
const GURL kPrerenderingUrl = GetUrl("/prerender/viewport.html?prerendering");
ASSERT_TRUE(NavigateToURL(shell(), kInitialUrl));
int host_id = AddPrerender(kPrerenderingUrl);
test::PrerenderHostObserver host_observer(*web_contents(), host_id);
RenderFrameHostImpl* prerender_rfh = GetPrerenderedMainFrameHost(host_id);
RenderFrameHostImpl* primary_rfh = web_contents_impl()->GetPrimaryMainFrame();
{
TestViewportWebContentsObserver observer(web_contents_impl(),
blink::mojom::ViewportFit::kCover);
EXPECT_TRUE(ExecJs(prerender_rfh, "setViewportFit('contain')"));
EXPECT_TRUE(ExecJs(primary_rfh, "setViewportFit('cover')"));
web_contents_impl()->FullscreenStateChanged(
primary_rfh, true, blink::mojom::FullscreenOptions::New());
observer.WaitForWantedValue();
}
{
TestViewportWebContentsObserver observer(
web_contents_impl(), blink::mojom::ViewportFit::kContain);
prerender_helper()->NavigatePrimaryPage(kPrerenderingUrl);
web_contents_impl()->FullscreenStateChanged(
prerender_rfh, true, blink::mojom::FullscreenOptions::New());
observer.WaitForWantedValue();
}
EXPECT_TRUE(host_observer.was_activated());
}
#endif
class PrerenderLowMemoryBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderLowMemoryBrowserTest, NoPrerender) { … }
class PrerenderSequentialPrerenderingBrowserTest : public PrerenderBrowserTest { … };
namespace {
class SequentialPrerenderObserver : public WebContentsObserver { … };
}
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
SequentialPrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
SkipCancelledPrerenderAndStartNextPrerender) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderSequentialPrerenderingBrowserTest,
IframeNavigationFinishDontDisruptPrerenderNavigationFinish) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
ActivateBeforePrerenderStarts) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
ExceedTheRequestNumberLimit) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
EmbedderPrerenderHandledImmediately) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
EmbedderHostBlocklisted) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
RunningHostCancellationStartPendingPrerender) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
SpeculationRulesUpdateStartPendingPrerender) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PreloadingTriggeringOutcomeForPendingPrerender) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderSequentialPrerenderingBrowserTest,
PreloadingTriggeringOutcomeForStartingPrerenderBeforeDestruction) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
CancelAllPrerenderUponActivationRequestArrival) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
MultipleNewTabPrerendering) { … }
void PrerenderSequentialPrerenderingBrowserTest::
TestSequentialPrerenderingVisibilityStateTransition(
Visibility initial_visibility,
Visibility next_visibility) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyVisible_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyVisible_Occluded) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyOccluded_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyOccluded_Occluded) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyHidden_Hidden) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyHidden_Occluded) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderInBackground_InitialyHidden_Visible) { … }
IN_PROC_BROWSER_TEST_F(PrerenderSequentialPrerenderingBrowserTest,
PrerenderWhenInitiatorInBackground_Queue_Processing) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
IsInactiveAndDisallowActivationCancelsPrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, InputRoutedToPrimaryFrameTree) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, VisibilityWhilePrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, TitleWhilePrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, TitleWasSetWithPrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, EmbedderPrerenderToNonHttpUrl) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, OpenURLInPrerenderingFrame) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DidFailLoadCancelsPrerendering) { … }
class DidFailLoadWebContentsObserver : public WebContentsObserver { … };
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DidFailLoadSubframesDoesNotCancelPrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DidFailLoadMainFrameCancelsPrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
OpenURLCrossOriginInPrerenderingFrame) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MainFrameNavigationDuringActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MainFrameNavigationConcurrentWithActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MainFrameNavigationAfterActivationIsResumed) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerenderWhenDeferringActivationNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DidFinishLoadInvokedAfterActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DidFinishLoadInvokedAfterActivationWithSubframes) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
DOMContentLoadedInvokedAfterActivationWithSubframes) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
DocumentOnLoadCompletedInPrimaryMainFrameInvokedAfterActivation) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
PrimaryMainDocumentElementAvailableInvokedAfterActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
LoadProgressChangedInvokedOnActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, OrderingOfDifferentLoadEvents) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CrossOriginSubframeNavigationDuringActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
OpenURLInSubframeDuringActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, LazyLoading) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SessionStorageAfterBackNavigation_NoProcessReuse) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SessionStorageAfterBackNavigation_KeepInitialProcess) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SessionStorage_TargetBlank_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, AbandonIfRendererProcessCrashes) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, AbandonIfRendererProcessIsKilled) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
AbandonIfPrimaryMainFrameRendererProcessIsKilled) { … }
class PrerenderBackForwardCacheBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderBackForwardCacheBrowserTest,
SessionStorageAfterBackNavigation) { … }
#if !BUILDFLAG(IS_ANDROID)
class PrerenderRestartStorageServiceBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderRestartStorageServiceBrowserTest,
RestartStorageServiceBeforePrerendering) { … }
IN_PROC_BROWSER_TEST_F(PrerenderRestartStorageServiceBrowserTest,
RestartStorageServiceWhilePrerendering) { … }
#endif
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SpeculationRulesScript) { … }
class PrerenderEagernessBrowserTest : public PrerenderBrowserTest { … };
namespace {
class PreloadingDeciderObserverForPrerenderTesting
: public PreloadingDeciderObserverForTesting { … };
}
IN_PROC_BROWSER_TEST_F(PrerenderEagernessBrowserTest, kEager) { … }
IN_PROC_BROWSER_TEST_F(PrerenderEagernessBrowserTest, kModerate) { … }
IN_PROC_BROWSER_TEST_F(PrerenderEagernessBrowserTest, kConservative) { … }
#if !BUILDFLAG(IS_FUCHSIA) && !BUILDFLAG(IS_IOS)
IN_PROC_BROWSER_TEST_F(PrerenderEagernessBrowserTest,
ReceivedPrerendersPerPrimaryPageChangedCount) { … }
IN_PROC_BROWSER_TEST_F(PrerenderEagernessBrowserTest,
NonEagerPrerendersCanBeRetriggeredAfterTimeout) { … }
class PrerenderNewLimitAndSchedulerBrowserTest
: public PrerenderEagernessBrowserTest,
public testing::WithParamInterface<std::string> { … };
INSTANTIATE_TEST_SUITE_P(All,
PrerenderNewLimitAndSchedulerBrowserTest,
testing::Values("_self", "_blank"),
[](const testing::TestParamInfo<std::string>& info) { … };
IN_PROC_BROWSER_TEST_P(PrerenderNewLimitAndSchedulerBrowserTest,
ResetForNonEagerPrerener) { … }
#endif
class PrerenderWithBackForwardCacheBrowserTest
: public PrerenderBrowserTest,
public testing::WithParamInterface<BackForwardCacheType> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(PrerenderWithBackForwardCacheBrowserTest,
HistoryNavigationAfterActivation) { … }
IN_PROC_BROWSER_TEST_P(PrerenderWithBackForwardCacheBrowserTest,
CancelOnAfterTriggerIsStoredInBackForwardCache_Forward) { … }
IN_PROC_BROWSER_TEST_P(PrerenderWithBackForwardCacheBrowserTest,
CancelOnAfterTriggerIsStoredInBackForwardCache_Back) { … }
class PrerenderBackForwardCacheRestorationBrowserTest
: public PrerenderEagernessBrowserTest,
public BackForwardCacheMetricsTestMatcher,
public testing::WithParamInterface<blink::mojom::SpeculationEagerness> { … };
INSTANTIATE_TEST_SUITE_P(
All,
PrerenderBackForwardCacheRestorationBrowserTest,
testing::Values(blink::mojom::SpeculationEagerness::kEager,
blink::mojom::SpeculationEagerness::kModerate,
blink::mojom::SpeculationEagerness::kConservative),
[](const testing::TestParamInfo<blink::mojom::SpeculationEagerness>& info) { … };
IN_PROC_BROWSER_TEST_P(PrerenderBackForwardCacheRestorationBrowserTest,
RestoredViaForwardNavigation) { … }
IN_PROC_BROWSER_TEST_P(PrerenderBackForwardCacheRestorationBrowserTest,
RestoredViaBackwardNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, StartByEmbeddersMultipleTimes) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
StartByEmbeddersAndSpeculationRulesMultipleTimes) { … }
class MultiplePrerendersBrowserTest : public PrerenderBrowserTest { … };
class MultiplePrerendersWithLimitedMemoryBrowserTest
: public MultiplePrerendersBrowserTest { … };
IN_PROC_BROWSER_TEST_F(MultiplePrerendersBrowserTest,
MemoryPressureOnTrigger_Moderate) { … }
IN_PROC_BROWSER_TEST_F(MultiplePrerendersBrowserTest,
MemoryPressureOnTrigger_Critical) { … }
IN_PROC_BROWSER_TEST_F(MultiplePrerendersBrowserTest,
MemoryPressureAfterTriggered_Moderate) { … }
IN_PROC_BROWSER_TEST_F(MultiplePrerendersBrowserTest,
MemoryPressureAfterTriggered_Critical) { … }
IN_PROC_BROWSER_TEST_F(MultiplePrerendersBrowserTest,
AddSpeculationRulesMultipleTimes) { … }
IN_PROC_BROWSER_TEST_F(MultiplePrerendersWithLimitedMemoryBrowserTest,
DevToolsOverride) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SkipCrossSitePrerender) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginNavigationSpeculationRulesWithoutOptInHeader) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginRedirectionSpeculationRulesWithoutOptInHeader) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginCredentialedPrerenderRedirectionSpeculationRulesWithoutOptInHeader) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginCredentialedPrerenderRedirectionSpeculationRulesWithoutOptInHeader2) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginNavigationBackToSameOriginWithoutOptInHeader) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CrossSiteMultipleRedirectionSpeculationRules) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CheckSameSiteCrossOriginSpeculationRulesPrerender) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
SameSiteCrossOriginSpeculationRulesRedirection) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
SameSiteCrossOriginSpeculationRulesMultipleRedirections) { … }
void PrerenderBrowserTest::TestEmbedderTriggerWithUnsupportedScheme(
const GURL& prerendering_url) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_UnsupportedScheme_ViewSource) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_UnsupportedScheme_DataUrl) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_SameOriginRedirection) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
EmbedderTrigger_CancelIfCrossOriginUrlInRedirectionChain) { … }
std::unique_ptr<PrerenderHandle>
PrerenderEmbedderTriggeredCrossOriginRedirectionPage(
WebContentsImpl& web_contents,
const GURL& prerendering_url,
const GURL& cross_origin_url) { … }
namespace {
class FrameDisplayStateChangedObserver : public WebContentsObserver { … };
}
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, FrameOwnerPropertiesDisplayNone) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, TriggeredPrerenderUkm) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ColorSchemeDarkInNonPrimaryPage) { … }
#if (BUILDFLAG(IS_WIN) && defined(ADDRESS_SANITIZER))
#define MAYBE_ThemeColorSchemeChangeInNonPrimaryPage …
#else
#define MAYBE_ThemeColorSchemeChangeInNonPrimaryPage …
#endif
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
MAYBE_ThemeColorSchemeChangeInNonPrimaryPage) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
TextAutosizerInfoChangeInNonPrimaryPage) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
VerifyFrameNameMaintainedAfterActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, ActivateWhileReloadingSubframe) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DoNotUpdateUserActivationState) { … }
IN_PROC_BROWSER_TEST_P(PrerenderTargetAgnosticBrowserTest, MixedContent) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderBlockedByCspNavigateTo) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
ActivatePageWithCspHeaderFrameSrc) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
ActivatePageWithCspHeaderSandboxFlags) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, VerifyPrerenderProcessVisibility) { … }
class PrerenderPurposePrefetchBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderPurposePrefetchBrowserTest, InitialNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderPurposePrefetchBrowserTest,
RedirectionOnInitialNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderPurposePrefetchBrowserTest, ResourceRequests) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, EnterFullscreen) { … }
namespace {
class TestJavaScriptDialogManager : public JavaScriptDialogManager,
public WebContentsDelegate { … };
class PrerenderWithRenderDocumentBrowserTest : public PrerenderBrowserTest { … };
}
IN_PROC_BROWSER_TEST_F(
PrerenderWithRenderDocumentBrowserTest,
ModalDialogShouldNotBeDismissedAfterPrerenderSubframeNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, NavigationHandleFrameType) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
NavigationHandleIsRendererInitiatedTrue) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
HasReceivedUserGestureBeforeNavigation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
HasReceivedUserGestureBeforeNavigation_Propagation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
CancelPrerenderWhenIsOverridingUserAgentDiffers) { … }
class PrerenderSpeculationRulesHoldbackBrowserTest
: public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderSpeculationRulesHoldbackBrowserTest,
PrerenderHoldbackTest) { … }
class PrerenderFencedFrameBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderFencedFrameBrowserTest,
CreateFencedFrameInPrerenderedPage) { … }
IN_PROC_BROWSER_TEST_F(PrerenderFencedFrameBrowserTest,
PrerenderFromFencedFrame_SpeculationRules) { … }
IN_PROC_BROWSER_TEST_F(PrerenderFencedFrameBrowserTest,
PrerenderFromFencedFrame_LinkSpeculationRules) { … }
namespace {
class PrerenderWithSiteIsolationDisabledBrowserTest
: public PrerenderBrowserTest { … };
}
IN_PROC_BROWSER_TEST_F(PrerenderWithSiteIsolationDisabledBrowserTest,
ForceSiteInstanceSwapForInitialPrerenderNavigation) { … }
class PrerenderClientHintsBrowserTest : public PrerenderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderClientHintsBrowserTest,
PrerenderResponseChangesClientHintsLocally) { … }
IN_PROC_BROWSER_TEST_F(PrerenderClientHintsBrowserTest,
ChangesToClientHintsAreDiscardIfNoActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderClientHintsBrowserTest,
PrimaryResponsesDoNotResetPrenderSettings) { … }
IN_PROC_BROWSER_TEST_F(PrerenderClientHintsBrowserTest, ViewPort_Width) { … }
IN_PROC_BROWSER_TEST_F(PrerenderClientHintsBrowserTest, ViewPort_Height) { … }
void CheckExpectedCrossOriginMetrics(
const base::HistogramTester& histogram_tester,
PrerenderCrossOriginRedirectionMismatch mismatch_type,
std::optional<PrerenderCrossOriginRedirectionProtocolChange>
protocol_change) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_SchemeHostPortMismatch) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_ProtocolUpgrade) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_ProtocolDowngrade) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_ToSubdomain) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_FromSubdomain) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
EmbedderTrigger_CrossOriginRedirection_DifferentDomain) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
PrerenderWithAccessibilityEnabled) { … }
class UpdateTargetURLDelegate : public WebContentsDelegate { … };
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, FocusChangeInPrerenderedPage) { … }
IN_PROC_BROWSER_TEST_F(
PrerenderBrowserTest,
UnusedRenderWidgetHostFrameTreePointerUpdatedOnActivation) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, WindowClosedSpeculationRules) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
WindowClosedSpeculationRules_WithTargetHintBlank) { … }
IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, SlowNetwork) { … }
class PrerenderSessionHistoryBrowserTest
: public PrerenderBrowserTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
BackButtonNavigation) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
PredictionForEligibleBackNavigation) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NoPredictionDueToBfcache) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
RendererNavigationAfterBackPrediction) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForSameDocument) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForSameSite) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForUncached) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForPostMethod) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForFailedNavigation) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForNonHttpScheme) { … }
bool IsScriptable(WebContentsImpl* opener, WebContentsImpl* openee) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
NotEligibleForRelatedActiveContents) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
PredictAfterOpeneeDestroyed) { … }
IN_PROC_BROWSER_TEST_P(PrerenderSessionHistoryBrowserTest,
BackNavigationOfCloneWebContents) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderSessionHistoryBrowserTest,
BackNavigationOfClonedWebContentsWithOriginalAtTargetEntry) { … }
IN_PROC_BROWSER_TEST_P(
PrerenderSessionHistoryBrowserTest,
BackButtonNavigationDoesNotUseSpeculationRulePrerenders) { … }
class PrerenderWarmUpCompositorBrowserTest
: public PrerenderBrowserTest,
public testing::WithParamInterface<std::tuple<bool, bool, std::string>> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(PrerenderWarmUpCompositorBrowserTest,
WarmingUpCCDoesntInvokeCrashes) { … }
}