#include <memory>
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/page_load_metrics/integration_tests/metric_integration_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
#include "components/page_load_metrics/browser/observers/back_forward_cache_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/page_load_metrics_test_waiter.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "components/page_load_metrics/common/test/page_load_metrics_test_util.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.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 "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
namespace {
UkmEntry;
PageEndReason;
class BackForwardCachePageLoadMetricsObserverBrowserTest
: public MetricIntegrationTest { … };
}
#if BUILDFLAG(IS_WIN)
#define MAYBE_FirstPaintAfterBackForwardCacheRestore …
#else
#define MAYBE_FirstPaintAfterBackForwardCacheRestore …
#endif
IN_PROC_BROWSER_TEST_F(BackForwardCachePageLoadMetricsObserverBrowserTest,
MAYBE_FirstPaintAfterBackForwardCacheRestore) { … }
IN_PROC_BROWSER_TEST_F(BackForwardCachePageLoadMetricsObserverBrowserTest,
FirstPaintAfterBackForwardCacheRestoreBackground) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define MAYBE_FirstInputDelayAfterBackForwardCacheRestoreBackground …
#else
#define MAYBE_FirstInputDelayAfterBackForwardCacheRestoreBackground …
#endif
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
MAYBE_FirstInputDelayAfterBackForwardCacheRestoreBackground) { … }
IN_PROC_BROWSER_TEST_F(BackForwardCachePageLoadMetricsObserverBrowserTest,
IsAmpPageAfterBackForwardCacheRestore) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_CumulativeLayoutShiftAfterBackForwardCacheRestore …
#else
#define MAYBE_CumulativeLayoutShiftAfterBackForwardCacheRestore …
#endif
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
MAYBE_CumulativeLayoutShiftAfterBackForwardCacheRestore) { … }
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
DISABLED_RequestAnimationFramesAfterBackForwardCacheRestore) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_LayoutShiftNormalization_AfterBackForwardCacheRestore …
#else
#define MAYBE_LayoutShiftNormalization_AfterBackForwardCacheRestore …
#endif
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
MAYBE_LayoutShiftNormalization_AfterBackForwardCacheRestore) { … }
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
ResumesLoggingAfterRestoringFromCacheAfterBackgrounding) { … }
#if defined(MEMORY_SANITIZER) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define MAYBE_ResponsivenessMetricsNormalizationWithSendingAllLatencies …
#else
#define MAYBE_ResponsivenessMetricsNormalizationWithSendingAllLatencies …
#endif
IN_PROC_BROWSER_TEST_F(
BackForwardCachePageLoadMetricsObserverBrowserTest,
MAYBE_ResponsivenessMetricsNormalizationWithSendingAllLatencies) { … }