#include "components/page_load_metrics/browser/observers/back_forward_cache_page_load_metrics_observer.h"
#include "base/memory/raw_ptr.h"
#include "base/test/simple_test_tick_clock.h"
#include "components/page_load_metrics/browser/fake_page_load_metrics_observer_delegate.h"
#include "components/page_load_metrics/browser/observers/page_load_metrics_observer_content_test_harness.h"
#include "components/page_load_metrics/browser/page_load_metrics_observer.h"
#include "components/page_load_metrics/browser/page_load_tracker.h"
#include "content/public/test/mock_navigation_handle.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
const char kTestUrl1[] = …;
Visibility;
FakePageLoadMetricsObserverDelegate;
PageLoadMetricsObserverDelegate;
HistoryNavigation;
UserPerceivedPageVisit;
class BackForwardCachePageLoadMetricsObserverTest
: public page_load_metrics::PageLoadMetricsObserverContentTestHarness { … };
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
OnRestoreFromBackForwardCache_NonAmpPageHasFalse) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
OnRestoreFromBackForwardCache_AmpPageHasTrue) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
OnNonBackForwardCacheNavigation_AmpPageIsUndefined) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
TestOnFirstPaintAfterBackForwardCacheRestoreInPage) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
TestBasicForegroundLogging) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
TestLoggingWithNoPageEndWithFirstBackgroundTime) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
TestLoggingWithNoPageEndWithNoFirstBackgroundTime) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
DoesNotLogForegroundDurationIfRestoredInBackground) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
DoesNotLogForegroundDurationIfWasHidden) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
DoesNotLogForegroundDurationIfNeverEnteredBFCache) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest,
TestPageEndWhenBackgrounding) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest, TestLogsNonCWVPageVisit) { … }
TEST_F(BackForwardCachePageLoadMetricsObserverTest, TestLogsUserInitiated) { … }