chromium/chrome/browser/page_load_metrics/observers/prefetch_page_load_metrics_observer_browsertest.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 "chrome/browser/page_load_metrics/observers/prefetch_page_load_metrics_observer.h"

#include <memory>

#include "base/command_line.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/prerender_test_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/embedded_test_server_connection_listener.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "testing/gtest/include/gtest/gtest.h"

class PrefetchPageLoadMetricsObserverBrowserTest : public InProcessBrowserTest {};

// TODO(http://crbug.com/1025737) Flaky on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_HistoryPlumbing
#else
#define MAYBE_HistoryPlumbing
#endif
IN_PROC_BROWSER_TEST_F(PrefetchPageLoadMetricsObserverBrowserTest,
                       MAYBE_HistoryPlumbing) {}

IN_PROC_BROWSER_TEST_F(PrefetchPageLoadMetricsObserverBrowserTest,
                       RecordNothingOnUntrackedPage) {}

class PrefetchPageLoadMetricsObserverPrerenderBrowserTest
    : public PrefetchPageLoadMetricsObserverBrowserTest {};

IN_PROC_BROWSER_TEST_F(PrefetchPageLoadMetricsObserverPrerenderBrowserTest,
                       PrerenderingShouldNotRecordMetrics) {}