chromium/chrome/browser/metrics/structured/chrome_structured_metrics_recorder_unittest.cc

// Copyright 2024 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/metrics/structured/chrome_structured_metrics_recorder.h"

#include <utility>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/threading/scoped_blocking_call.h"
#include "components/metrics/structured/event.h"
#include "components/metrics/structured/key_data_prefs_delegate.h"
#include "components/metrics/structured/lib/key_util.h"
#include "components/metrics/structured/lib/proto/key.pb.h"
#include "components/metrics/structured/proto/event_storage.pb.h"
#include "components/metrics/structured/structured_events.h"
#include "components/metrics/structured/structured_metrics_client.h"
#include "components/metrics/structured/structured_metrics_prefs.h"
#include "components/metrics/structured/structured_metrics_validator.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"

namespace metrics::structured {

namespace {

// These project, event, and metric names are used for testing.

// The name hash of "TestProjectFour".
constexpr uint64_t kProjectFourHash =;

// The name hash of "chrome::TestProjectFour::TestEventFive".
constexpr uint64_t kEventFiveHash =;

// The name hash of "TestMetricFive".
constexpr uint64_t kMetricFiveHash =;

// The hex-encoded first 8 bytes of SHA256("ddd...d")
constexpr char kProjectFourId[] =;

std::string HashToHex(const uint64_t hash) {}

class TestRecorder : public StructuredMetricsClient::RecordingDelegate {};

}  // namespace

class ChromeStructuredMetricsRecorderTest : public testing::Test {};

TEST_F(ChromeStructuredMetricsRecorderTest, DeviceEventsRecorded) {}

}  // namespace metrics::structured