#include "chrome/browser/page_load_metrics/observers/service_worker_page_load_metrics_observer.h"
#include <memory>
#include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h"
#include "components/page_load_metrics/browser/page_load_tracker.h"
#include "components/page_load_metrics/common/test/page_load_metrics_test_util.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/web_contents.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
namespace {
const char kDefaultTestUrl[] = …;
const char kSearchTestUrl[] = …;
}
class ServiceWorkerPageLoadMetricsObserverTest
: public page_load_metrics::PageLoadMetricsObserverTestHarness { … };
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoMetrics) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, NoServiceWorker) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorker) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, WithServiceWorkerBackground) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchSite) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest, SearchNoSWSite) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest,
WithServiceWorker_ForwardBack) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest,
WithServiceWorker_SkippableFetchHandler) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest,
WithServiceWorker_NonSkippableFetchHandler) { … }
TEST_F(ServiceWorkerPageLoadMetricsObserverTest,
FlushMetricsOnAppEnterBackground) { … }