chromium/components/page_load_metrics/browser/test_metrics_web_contents_observer_embedder.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/page_load_metrics/browser/test_metrics_web_contents_observer_embedder.h"

#include <memory>

#include "base/memory/raw_ptr.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/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"

namespace page_load_metrics {

namespace {

// Simple PageLoadMetricsObserver that copies observed PageLoadTimings into the
// provided std::vector, so they can be analyzed by unit tests.
class TimingLoggingPageLoadMetricsObserver final
    : public PageLoadMetricsObserver {};

// Test PageLoadMetricsObserver that stops observing page loads with certain
// substrings in the URL.
class FilteringPageLoadMetricsObserver final : public PageLoadMetricsObserver {};

}  // namespace

TestMetricsWebContentsObserverEmbedder::
    TestMetricsWebContentsObserverEmbedder() = default;

TestMetricsWebContentsObserverEmbedder::
    ~TestMetricsWebContentsObserverEmbedder() = default;

bool TestMetricsWebContentsObserverEmbedder::IsNewTabPageUrl(const GURL& url) {}

void TestMetricsWebContentsObserverEmbedder::RegisterObservers(
    PageLoadTracker* tracker) {}

std::unique_ptr<base::OneShotTimer>
TestMetricsWebContentsObserverEmbedder::CreateTimer() {}

bool TestMetricsWebContentsObserverEmbedder::IsNoStatePrefetch(
    content::WebContents* web_contents) {}

bool TestMetricsWebContentsObserverEmbedder::IsExtensionUrl(const GURL& url) {}

bool TestMetricsWebContentsObserverEmbedder::IsSidePanel(
    content::WebContents* web_contents) {}

bool TestMetricsWebContentsObserverEmbedder::IsNonTabWebUI() {}

PageLoadMetricsMemoryTracker*
TestMetricsWebContentsObserverEmbedder::GetMemoryTrackerForBrowserContext(
    content::BrowserContext* browser_context) {}

}  // namespace page_load_metrics