chromium/chrome/browser/ui/tabs/tab_ukm_test_helper.cc

// Copyright 2018 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/ui/tabs/tab_ukm_test_helper.h"
#include "base/memory/raw_ptr.h"

#include <sstream>

#include "base/ranges/algorithm.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

// Verifies each expected metric's value. Metrics not in |expected_metrics| are
// ignored. A metric value of |nullopt| implies the metric shouldn't exist.
void ExpectEntryMetrics(const ukm::mojom::UkmEntry& entry,
                        const UkmMetricMap& expected_metrics) {}

// Returns true if each metric in |expected_metrics| has the same value in the
// given entry. An expected metric value of |nullopt| implies a value shouldn't
// exist in the entry.
bool EntryContainsMetrics(const ukm::mojom::UkmEntry* entry,
                          const UkmMetricMap& expected_metrics) {}

// Returns an iterator to an entry whose metrics match |expected_metrics|,
// or end() if not found.
std::vector<
    raw_ptr<const ukm::mojom::UkmEntry, VectorExperimental>>::const_iterator
FindMatchingEntry(
    const std::vector<raw_ptr<const ukm::mojom::UkmEntry, VectorExperimental>>&
        entries,
    const UkmMetricMap& expected_metrics) {}

}  // namespace

UkmEntryChecker::UkmEntryChecker() = default;

UkmEntryChecker::~UkmEntryChecker() {}

void UkmEntryChecker::ExpectNewEntry(const std::string& entry_name,
                                     const GURL& source_url,
                                     const UkmMetricMap& expected_metrics) {}

void UkmEntryChecker::ExpectNewEntries(
    const std::string& entry_name,
    const std::vector<UkmMetricMap>& expected_entries) {}

void UkmEntryChecker::ExpectNewEntriesBySource(
    const std::string& entry_name,
    const SourceUkmMetricMap& expected_data) {}

int UkmEntryChecker::NumNewEntriesRecorded(
    const std::string& entry_name) const {}

size_t UkmEntryChecker::NumEntries(const std::string& entry_name) const {}

const ukm::mojom::UkmEntry* UkmEntryChecker::LastUkmEntry(
    const std::string& entry_name) const {}