chromium/components/page_load_metrics/browser/observers/page_load_metrics_observer_tester.cc

// Copyright 2017 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/observers/page_load_metrics_observer_tester.h"
#include "base/memory/raw_ptr.h"

#include <memory>
#include <string>
#include <utility>

#include "base/time/time.h"
#include "base/timer/timer.h"
#include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
#include "components/page_load_metrics/browser/page_load_metrics_embedder_interface.h"
#include "components/page_load_metrics/common/page_load_metrics.mojom.h"
#include "components/page_load_metrics/common/page_load_timing.h"
#include "content/public/browser/cookie_access_details.h"
#include "content/public/browser/media_player_id.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "net/base/ip_endpoint.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
#include "url/gurl.h"

namespace content {
class BrowserContext;
}  // namespace content

namespace page_load_metrics {

class PageLoadMetricsMemoryTracker;

namespace {

class TestPageLoadMetricsEmbedderInterface
    : public PageLoadMetricsEmbedderInterface {};

}  // namespace

PageLoadMetricsObserverTester::PageLoadMetricsObserverTester(
    content::WebContents* web_contents,
    content::RenderViewHostTestHarness* rfh_test_harness,
    const RegisterObserversCallback& callback,
    bool is_non_tab_webui)
    :{}

PageLoadMetricsObserverTester::~PageLoadMetricsObserverTester() {}

void PageLoadMetricsObserverTester::StartNavigation(const GURL& gurl) {}

void PageLoadMetricsObserverTester::NavigateWithPageTransitionAndCommit(
    const GURL& url,
    ui::PageTransition transition) {}

void PageLoadMetricsObserverTester::NavigateToUntrackedUrl() {}

void PageLoadMetricsObserverTester::SimulateTimingUpdate(
    const mojom::PageLoadTiming& timing) {}

void PageLoadMetricsObserverTester::SimulateTimingUpdate(
    const mojom::PageLoadTiming& timing,
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateCpuTimingUpdate(
    const mojom::CpuTiming& cpu_timing) {}

void PageLoadMetricsObserverTester::SimulateCpuTimingUpdate(
    const mojom::CpuTiming& cpu_timing,
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateInputTimingUpdate(
    const mojom::InputTiming& input_timing) {}

void PageLoadMetricsObserverTester::SimulateInputTimingUpdate(
    const mojom::InputTiming& input_timing,
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateTimingAndMetadataUpdate(
    const mojom::PageLoadTiming& timing,
    const mojom::FrameMetadata& metadata) {}

void PageLoadMetricsObserverTester::SimulateMetadataUpdate(
    const mojom::FrameMetadata& metadata,
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateFeaturesUpdate(
    const std::vector<blink::UseCounterFeature>& new_features) {}

void PageLoadMetricsObserverTester::SimulateRenderDataUpdate(
    const mojom::FrameRenderDataUpdate& render_data) {}

void PageLoadMetricsObserverTester::SimulateRenderDataUpdate(
    const mojom::FrameRenderDataUpdate& render_data,
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateSoftNavigation(
    content::NavigationHandle* navigation_handle) {}

void PageLoadMetricsObserverTester::SimulateDidFinishNavigation(
    content::NavigationHandle* navigation_handle) {}

void PageLoadMetricsObserverTester::SimulateSoftNavigationCountUpdate(
    const mojom::SoftNavigationMetrics& soft_navigation_metrics) {}

void PageLoadMetricsObserverTester::SimulatePageLoadTimingUpdate(
    const mojom::PageLoadTiming& timing,
    const mojom::FrameMetadata& metadata,
    const std::vector<blink::UseCounterFeature>& new_features,
    const mojom::FrameRenderDataUpdate& render_data,
    const mojom::CpuTiming& cpu_timing,
    const mojom::InputTiming& input_timing,
    const std::optional<blink::SubresourceLoadMetrics>&
        subresource_load_metrics,
    content::RenderFrameHost* rfh,
    const mojom::SoftNavigationMetrics& soft_navigation_metrics) {}

void PageLoadMetricsObserverTester::SimulateResourceDataUseUpdate(
    const std::vector<mojom::ResourceDataUpdatePtr>& resources) {}

void PageLoadMetricsObserverTester::SimulateResourceDataUseUpdate(
    const std::vector<mojom::ResourceDataUpdatePtr>& resources,
    content::RenderFrameHost* render_frame_host) {}

void PageLoadMetricsObserverTester::SimulateLoadedResource(
    const ExtraRequestCompleteInfo& info) {}

void PageLoadMetricsObserverTester::SimulateLoadedResource(
    const ExtraRequestCompleteInfo& info,
    const content::GlobalRequestID& request_id) {}

void PageLoadMetricsObserverTester::SimulateFrameReceivedUserActivation(
    content::RenderFrameHost* render_frame_host) {}

void PageLoadMetricsObserverTester::SimulateInputEvent(
    const blink::WebInputEvent& event) {}

void PageLoadMetricsObserverTester::SimulateAppEnterBackground() {}

void PageLoadMetricsObserverTester::SimulateMediaPlayed() {}

void PageLoadMetricsObserverTester::SimulateMediaPlayed(
    content::RenderFrameHost* rfh) {}

void PageLoadMetricsObserverTester::SimulateCookieAccess(
    const content::CookieAccessDetails& details) {}

void PageLoadMetricsObserverTester::SimulateStorageAccess(
    const GURL& url,
    const GURL& first_party_url,
    bool blocked_by_policy,
    StorageType storage_type) {}

void PageLoadMetricsObserverTester::SimulateCustomUserTimingUpdate(
    mojom::CustomUserTimingMarkPtr custom_timing) {}

const PageLoadMetricsObserverDelegate&
PageLoadMetricsObserverTester::GetDelegateForCommittedLoad() const {}

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

void PageLoadMetricsObserverTester::SimulateMemoryUpdate(
    content::RenderFrameHost* render_frame_host,
    int64_t delta_bytes) {}

}  // namespace page_load_metrics