chromium/chrome/browser/page_load_metrics/observers/page_anchors_metrics_observer_browsertest.cc

// Copyright 2023 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/page_anchors_metrics_observer.h"

#include <string_view>

#include "base/memory/raw_ptr.h"
#include "base/test/scoped_run_loop_timeout.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/browser_test_utils.h"
#include "net/dns/mock_host_resolver.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 PageAnchorsMetricsObserverBrowserTest
    : public InProcessBrowserTest,
      public testing::WithParamInterface<bool>,
      public content::WebContentsObserver {};

// Disabled for being flaky. See crbug.com/1471215
IN_PROC_BROWSER_TEST_F(PageAnchorsMetricsObserverBrowserTest,
                       DISABLED_NavigateAwayShouldRecordUkmData) {}

IN_PROC_BROWSER_TEST_F(PageAnchorsMetricsObserverBrowserTest,
                       BFCacheShouldRecordUkmData) {}

// TODO(crbug.com/40273087): Test is flaky.
IN_PROC_BROWSER_TEST_F(PageAnchorsMetricsObserverBrowserTest,
                       DISABLED_TestDifferentUKMSourceIdsPerNavigation) {}

IN_PROC_BROWSER_TEST_F(PageAnchorsMetricsObserverBrowserTest,
                       NavigateToSameUrlTwice) {}