chromium/components/metrics/metrics_state_manager_unittest.cc

// Copyright 2014 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/metrics/metrics_state_manager.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <string>
#include <utility>

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/metrics/client_info.h"
#include "components/metrics/metrics_data_validation.h"
#include "components/metrics/metrics_log.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_service.h"
#include "components/metrics/metrics_switches.h"
#include "components/metrics/test/test_enabled_state_provider.h"
#include "components/prefs/testing_pref_service.h"
#include "components/variations/pref_names.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"

namespace metrics {
namespace {

// Verifies that the client id follows the expected pattern.
void VerifyClientId(const std::string& client_id) {}

MATCHER(HaveClonedInstallInfo, "") {}

MATCHER(HaveNoClonedInstallInfo, "") {}

}  // namespace

class MetricsStateManagerTest : public testing::Test {};

TEST_F(MetricsStateManagerTest, ClientIdCorrectlyFormatted_ConsentInitially) {}

TEST_F(MetricsStateManagerTest, ClientIdCorrectlyFormatted_ConsentLater) {}

TEST_F(MetricsStateManagerTest, EntropySourceUsed_Low) {}

TEST_F(MetricsStateManagerTest, EntropySourceUsed_High) {}

TEST_F(MetricsStateManagerTest, EntropySourceUsed_High_ExternalClientId) {}

TEST_F(MetricsStateManagerTest,
       EntropySourceUsed_High_ExternalClientId_MetricsReportingDisabled) {}

// Check that setting the kMetricsResetIds pref to true causes the client id to
// be reset. We do not check that the low entropy source is reset because we
// cannot ensure that metrics state manager won't generate the same id again.
TEST_F(MetricsStateManagerTest, ResetMetricsIDs) {}

TEST_F(MetricsStateManagerTest, LogHasSessionShutdownCleanly) {}

TEST_F(MetricsStateManagerTest, LogSessionHasNotYetShutdownCleanly) {}

TEST_F(MetricsStateManagerTest, ForceClientIdCreation) {}

TEST_F(MetricsStateManagerTest,
       ForceClientIdCreation_ConsentIntitially_NoInstallDate) {}

#if !BUILDFLAG(IS_WIN)
TEST_F(MetricsStateManagerTest, ProvisionalClientId_PromotedToClientId) {}

TEST_F(MetricsStateManagerTest, ProvisionalClientId_PersistedAcrossFirstRuns) {}
#endif  // !BUILDFLAG(IS_WIN)

TEST_F(MetricsStateManagerTest, LoadPrefs) {}

TEST_F(MetricsStateManagerTest, PreferPrefs) {}

TEST_F(MetricsStateManagerTest, RestoreBackup) {}

TEST_F(MetricsStateManagerTest, ResetBackup) {}

TEST_F(MetricsStateManagerTest, CheckProvider) {}

TEST_F(MetricsStateManagerTest, CheckProviderLogNormal) {}

TEST_F(MetricsStateManagerTest, CheckProviderLogNormalWithParams) {}

TEST_F(MetricsStateManagerTest, CheckClientIdWasNotUsedToAssignFieldTrial) {}

TEST_F(MetricsStateManagerTest, CheckClientIdWasUsedToAssignFieldTrial) {}

TEST_F(MetricsStateManagerTest, CheckProviderResetIds) {}

TEST_F(MetricsStateManagerTest,
       CheckProviderResetIds_PreviousIdOnlyReportInResetSession) {}

TEST_F(MetricsStateManagerTest, UseExternalClientId) {}

}  // namespace metrics