chromium/components/ukm/ukm_recorder_impl_unittest.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 "components/ukm/ukm_recorder_impl.h"

#include <string_view>

#include "base/functional/bind.h"
#include "base/metrics/metrics_hashes.h"
#include "base/test/task_environment.h"
#include "components/ukm/scheme_constants.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/ukm/ukm_recorder_observer.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_entry_builder.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_source.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/ukm/report.pb.h"
#include "url/gurl.h"

namespace ukm {
namespace {

TestEvent1;

const uint64_t kTestEntryHash =;
const uint64_t kTestMetricsHash =;
const char kTestEntryName[] =;
const char kTestMetrics[] =;
const int32_t kWebDXFeature1 =;
const int32_t kWebDXFeature2 =;
const size_t kWebDXFeatureNumberOfFeaturesForTesting =;

// Builds a blank UkmEntry with given SourceId.
mojom::UkmEntryPtr BlankUkmEntry(SourceId source_id) {}

std::map<uint64_t, builders::EntryDecoder> CreateTestingDecodeMap() {}

// Helper class for testing UkmRecorderImpl observers.
class TestUkmObserver : public UkmRecorderObserver {};

}  // namespace

TEST(UkmRecorderImplTest, IsSampledIn) {}

TEST(UkmRecorderImplTest, PurgeExtensionRecordings) {}

TEST(UkmRecorderImplTest, WebApkSourceUrl) {}

TEST(UkmRecorderImplTest, PaymentAppScopeUrl) {}

TEST(UkmRecorderImplTest, WebIdentityScopeUrl) {}

// Tests that UkmRecorderObserver is notified on a new UKM entry.
TEST(UkmRecorderImplTest, ObserverNotifiedOnNewEntry) {}

// Tests that UkmRecorderObserver is notified on source URL updates.
TEST(UkmRecorderImplTest, ObserverNotifiedOnSourceURLUpdate) {}

// Tests that UkmRecorderObserver is notified on source URL updates.
TEST(UkmRecorderImplTest, ObserverNotifiedWhenNotRecording) {}

// Tests that UkmRecorderObserver is notified on purge.
TEST(UkmRecorderImplTest, ObserverNotifiedOnPurge) {}

TEST(UkmRecorderImplTest, ObserverNotifiedOnUkmAllowedStateChanged) {}

// Tests that adding and removing observers work as expected.
TEST(UkmRecorderImplTest, AddRemoveObserver) {}

TEST(UkmRecorderImplTest, VerifyShouldDropEntry) {}

TEST(UkmRecorderImplTest, WebDXFeaturesConsent) {}

TEST(UkmRecorderImplTest, WebDXFeaturesSampling) {}

}  // namespace ukm