#include <iterator>
#include <memory>
#include <string>
#include <string_view>
#include <unordered_set>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/containers/to_vector.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/trace_event_analyzer.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer.h"
#include "chrome/browser/page_load_metrics/observers/document_write_page_load_metrics_observer.h"
#include "chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h"
#include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_manager_factory.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_test_utils.h"
#include "chrome/browser/preloading/preview/preview_test_util.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/sessions/session_restore_test_helper.h"
#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/session_service_test_helper.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/content_settings/core/common/features.h"
#include "components/embedder_support/user_agent_utils.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_handle.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_manager.h"
#include "components/no_state_prefetch/browser/prerender_histograms.h"
#include "components/no_state_prefetch/common/no_state_prefetch_origin.h"
#include "components/page_load_metrics/browser/observers/abandoned_page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/observers/core/uma_page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/observers/use_counter_page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h"
#include "components/page_load_metrics/browser/page_load_tracker.h"
#include "components/prefs/pref_service.h"
#include "components/sessions/content/content_test_helper.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/back_forward_cache.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/tracing_controller.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/referrer.h"
#include "content/public/common/result_codes.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/download_test_observer.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/navigation_handle_observer.h"
#include "content/public/test/no_renderer_crashes_assertion.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/base/net_errors.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/chrome_debug_urls.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
PageEndReason;
PageLoadMetricsTestWaiter;
TimingField;
WebFeature;
SizeIs;
UnorderedElementsAre;
NoStatePrefetch;
PageLoad;
HistoryNavigation;
Query;
TraceAnalyzer;
TraceEventVector;
namespace {
constexpr char kCacheablePathPrefix[] = …;
const char kResponseWithNoStore[] = …;
constexpr char kCreateFrameAtPositionScript[] = …;
constexpr char kCreateFrameAtPositionNotifyOnLoadScript[] = …;
constexpr char kCreateFrameAtTopRightPositionScript[] = …;
std::unique_ptr<net::test_server::HttpResponse> HandleCachableRequestHandler(
const net::test_server::HttpRequest& request) { … }
}
class PageLoadMetricsBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PageLCPImagePriority) { … }
class PageLoadMetricsBrowserTestAnimatedLCP
: public PageLoadMetricsBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NoNavigation) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
DISABLED_MainFrameViewportRect) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersection_RTLPage …
#else
#define MAYBE_MainFrameIntersection_RTLPage …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersection_RTLPage) { … }
IN_PROC_BROWSER_TEST_F(
PageLoadMetricsBrowserTest,
DISABLED_NonZeroMainFrameScrollOffset_NestedSameOriginFrame_MainFrameIntersection) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
#define MAYBE_NonZeroMainFrameScrollOffset_NestedCrossOriginFrame_MainFrameIntersection …
#else
#define MAYBE_NonZeroMainFrameScrollOffset_NestedCrossOriginFrame_MainFrameIntersection …
#endif
IN_PROC_BROWSER_TEST_F(
PageLoadMetricsBrowserTest,
MAYBE_NonZeroMainFrameScrollOffset_NestedCrossOriginFrame_MainFrameIntersection) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_NonZeroMainFrameScrollOffset_SameOriginFrameAppended_MainFrameIntersection …
#else
#define MAYBE_NonZeroMainFrameScrollOffset_SameOriginFrameAppended_MainFrameIntersection …
#endif
IN_PROC_BROWSER_TEST_F(
PageLoadMetricsBrowserTest,
MAYBE_NonZeroMainFrameScrollOffset_SameOriginFrameAppended_MainFrameIntersection) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_NonZeroMainFrameScrollOffset_CrossOriginFrameAppended_MainFrameIntersection …
#else
#define MAYBE_NonZeroMainFrameScrollOffset_CrossOriginFrameAppended_MainFrameIntersection …
#endif
IN_PROC_BROWSER_TEST_F(
PageLoadMetricsBrowserTest,
MAYBE_NonZeroMainFrameScrollOffset_CrossOriginFrameAppended_MainFrameIntersection) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NewPage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, Redirect) { … }
class PageLoadMetricsPre3pcdBrowserTest : public PageLoadMetricsBrowserTest { … };
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_NoStatePrefetchMetrics …
#else
#define MAYBE_NoStatePrefetchMetrics …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsPre3pcdBrowserTest,
MAYBE_NoStatePrefetchMetrics) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, CachedPage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, MainFrameHasNoStore) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MainFrameDoesnotHaveNoStore) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NewPageInNewForegroundTab) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NoPaintForEmptyDocument) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_NoPaintForEmptyDocumentInChildFrame …
#else
#define MAYBE_NoPaintForEmptyDocumentInChildFrame …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_NoPaintForEmptyDocumentInChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PaintInChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PaintInDynamicChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PaintInMultipleChildFrames) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_PaintInMainAndChildFrame …
#else
#define MAYBE_PaintInMainAndChildFrame …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_PaintInMainAndChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, SameDocumentNavigation) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, SameUrlNavigation) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
DocWriteAbortsSubframeNavigation) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NonHtmlMainResource) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_NonHttpOrHttpsUrl …
#else
#define MAYBE_NonHttpOrHttpsUrl …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, MAYBE_NonHttpOrHttpsUrl) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, HttpErrorPage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, ChromeErrorPage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, Ignore204Pages) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, IgnoreDownloads) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NoDocumentWrite) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_DocumentWriteBlock …
#else
#define MAYBE_DocumentWriteBlock …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, MAYBE_DocumentWriteBlock) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN)
#define MAYBE_DocumentWriteReload …
#else
#define MAYBE_DocumentWriteReload …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, MAYBE_DocumentWriteReload) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, DocumentWriteAsync) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, DocumentWriteSameDomain) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, NoDocumentWriteScript) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, DISABLED_BadXhtml) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PayloadSize) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PayloadSizeChildFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
PayloadSizeIgnoresDownloads) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterFeaturesInMainFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterCSSPropertiesInMainFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterAnimatedCSSPropertiesInMainFrame) { … }
class PageLoadMetricsBrowserTestWithAutoupgradesDisabled
: public PageLoadMetricsBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
UseCounterFeaturesMixedContent) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
UseCounterCSSPropertiesMixedContent) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
UseCounterAnimatedCSSPropertiesMixedContent) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterFeaturesInNonSecureMainFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterUkmFeaturesLogged) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
UseCounterUkmMixedContentFeaturesLogged) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, UseCounterFeaturesInIframe) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterFeaturesInMultipleIframes) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterCSSPropertiesInIframe) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterCSSPropertiesInMultipleIframes) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterAnimatedCSSPropertiesInIframe) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterAnimatedCSSPropertiesInMultipleIframes) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterObserveSVGImagePage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterPermissionsPolicyUsageInMainFrame) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterPermissionsPolicyUsageInIframe) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
UseCounterPermissionsPolicyUsageInMultipleIframes) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, LoadingMetrics) { … }
class SessionRestorePageLoadMetricsBrowserTest
: public PageLoadMetricsBrowserTest { … };
class SessionRestorePaintWaiter : public SessionRestoreObserver { … };
IN_PROC_BROWSER_TEST_F(SessionRestorePageLoadMetricsBrowserTest,
InitialVisibilityOfSingleRestoredTab) { … }
IN_PROC_BROWSER_TEST_F(SessionRestorePageLoadMetricsBrowserTest,
InitialVisibilityOfMultipleRestoredTabs) { … }
enum class ReduceTransferSizeUpdatedIPCTestCase { … };
class PageLoadMetricsResourceLoadBrowserTest
: public PageLoadMetricsBrowserTest,
public ::testing::WithParamInterface<
ReduceTransferSizeUpdatedIPCTestCase> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(PageLoadMetricsResourceLoadBrowserTest,
DISABLED_ReceivedAggregateResourceDataLength) { … }
IN_PROC_BROWSER_TEST_P(PageLoadMetricsResourceLoadBrowserTest,
ChunkedResponse_OverheadDoesNotCountForBodyBytes) { … }
IN_PROC_BROWSER_TEST_P(PageLoadMetricsResourceLoadBrowserTest,
ReceivedCompleteResources) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_InputEventsForClick …
#else
#define MAYBE_InputEventsForClick …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, MAYBE_InputEventsForClick) { … }
class SoftNavigationBrowserTest : public PageLoadMetricsBrowserTest { … };
class SoftNavigationBrowserTestWithSoftNavigationHeuristicsFlag
: public SoftNavigationBrowserTest { … };
IN_PROC_BROWSER_TEST_F(SoftNavigationBrowserTest, DISABLED_SoftNavigation) { … }
IN_PROC_BROWSER_TEST_F(
SoftNavigationBrowserTestWithSoftNavigationHeuristicsFlag,
DISABLED_SoftNavigation) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, InputEventsForOmniboxMatch) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_InputEventsForJavaScriptHref …
#else
#define MAYBE_InputEventsForJavaScriptHref …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_InputEventsForJavaScriptHref) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
InputEventsForJavaScriptWindowOpen) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, FirstInputFromScroll) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, ServiceWorkerMetrics) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
ServiceWorkerSkippableFetchHandlerMetrics) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PreCommitWebFeature) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionsMainFrame …
#else
#define MAYBE_MainFrameIntersectionsMainFrame …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionsMainFrame) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionSingleFrame …
#else
#define MAYBE_MainFrameIntersectionSingleFrame …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionSingleFrame) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionSameOrigin …
#else
#define MAYBE_MainFrameIntersectionSameOrigin …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionSameOrigin) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionCrossOrigin …
#else
#define MAYBE_MainFrameIntersectionCrossOrigin …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionCrossOrigin) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionCrossOriginOutOfView …
#else
#define MAYBE_MainFrameIntersectionCrossOriginOutOfView …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionCrossOriginOutOfView) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_MainFrameIntersectionCrossOriginScrolled …
#else
#define MAYBE_MainFrameIntersectionCrossOriginScrolled …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_MainFrameIntersectionCrossOriginScrolled) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, PageLCPStopsUponInput) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC)
class PageLoadMetricsPreviewBrowserTest : public PageLoadMetricsBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageLoadMetricsPreviewBrowserTest,
PreviewPrimaryPageType) { … }
#endif
class PageLoadMetricsBrowserTestTerminatedPage
: public PageLoadMetricsBrowserTest { … };
class PageLoadMetricsBrowserTestDiscardedPage
: public PageLoadMetricsBrowserTestTerminatedPage,
public ::testing::WithParamInterface<bool> { … };
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBrowserTestDiscardedPage,
UkmIsRecordedForDiscardedTabPage) { … }
INSTANTIATE_TEST_SUITE_P(…);
class PageLoadMetricsBrowserTestClosedPage
: public PageLoadMetricsBrowserTestTerminatedPage,
public ::testing::WithParamInterface<bool> { … };
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBrowserTestClosedPage,
UkmIsRecordedForClosedTabPage) { … }
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestTerminatedPage,
UkmIsRecordedWhenRenderProcessShutsDown) { … }
class PageLoadMetricsBrowserTestCrashedPage
: public PageLoadMetricsBrowserTestTerminatedPage,
public ::testing::WithParamInterface<const char*> { … };
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_UkmIsRecordedForCrashedTabPage …
#else
#define MAYBE_UkmIsRecordedForCrashedTabPage …
#endif
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBrowserTestCrashedPage,
MAYBE_UkmIsRecordedForCrashedTabPage) { … }
INSTANTIATE_TEST_SUITE_P(…);
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_WIN)
#define MAYBE_PageLCPAnimatedImage …
#else
#define MAYBE_PageLCPAnimatedImage …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestAnimatedLCP,
MAYBE_PageLCPAnimatedImage) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_PageLCPNonAnimatedImage …
#else
#define MAYBE_PageLCPNonAnimatedImage …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestAnimatedLCP,
MAYBE_PageLCPNonAnimatedImage) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, FirstInputDelayFromClick) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest, SameOriginNavigation) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_CrossOriginNavigation …
#else
#define MAYBE_CrossOriginNavigation …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
MAYBE_CrossOriginNavigation) { … }
class PageLoadMetricsBrowserTestWithFencedFrames
: public PageLoadMetricsBrowserTest { … };
#if BUILDFLAG(IS_WIN)
#define MAYBE_PageLoadPrivacySandboxAdsFencedFramesMetrics …
#else
#define MAYBE_PageLoadPrivacySandboxAdsFencedFramesMetrics …
#endif
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithFencedFrames,
MAYBE_PageLoadPrivacySandboxAdsFencedFramesMetrics) { … }
class PageLoadMetricsBrowserTestWithBackForwardCache
: public PageLoadMetricsBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithBackForwardCache,
BackForwardCacheEvent) { … }
IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithBackForwardCache,
UseCounterUkmFeaturesLoggedOnBFCacheEviction) { … }
class NavigationPageLoadMetricsBrowserTest
: public PageLoadMetricsBrowserTest,
public ::testing::WithParamInterface<std::string> { … };
IN_PROC_BROWSER_TEST_P(NavigationPageLoadMetricsBrowserTest, FirstInputDelay) { … }
std::vector<std::string> NavigationPageLoadMetricsBrowserTestTestValues() { … }
INSTANTIATE_TEST_SUITE_P(…);
class PrerenderPageLoadMetricsBrowserTest : public PageLoadMetricsBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderPageLoadMetricsBrowserTest, PrerenderEvent) { … }
IN_PROC_BROWSER_TEST_F(PrerenderPageLoadMetricsBrowserTest,
PrerenderingDoNotRecordUKM) { … }
enum BackForwardCacheStatus { … };
class PageLoadMetricsBackForwardCacheBrowserTest
: public PageLoadMetricsBrowserTest,
public testing::WithParamInterface<BackForwardCacheStatus> { … };
void PageLoadMetricsBackForwardCacheBrowserTest::VerifyPageEndReasons(
const std::vector<PageEndReason>& reasons,
const GURL& url,
bool is_bfcache_enabled) { … }
int64_t PageLoadMetricsBackForwardCacheBrowserTest::CountForMetricForURL(
std::string_view entry_name,
std::string_view metric_name,
const GURL& url) { … }
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBackForwardCacheBrowserTest,
LogsPageEndReasons) { … }
void PageLoadMetricsBackForwardCacheBrowserTest::ExpectNewForegroundDuration(
const GURL& url,
bool expect_bfcache) { … }
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBackForwardCacheBrowserTest,
LogsBasicPageForegroundDuration) { … }
IN_PROC_BROWSER_TEST_P(PageLoadMetricsBackForwardCacheBrowserTest,
LogsPageForegroundDurationOnHide) { … }
INSTANTIATE_TEST_SUITE_P(…);