#include "components/metrics/metrics_log.h"
#include <stddef.h>
#include <stdint.h>
#include <string>
#include "base/base64.h"
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/bucket_ranges.h"
#include "base/metrics/sample_vector.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/test/simple_test_clock.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/task_environment.h"
#include "base/time/default_clock.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/metrics/cpu_metrics_provider.h"
#include "components/metrics/delegating_provider.h"
#include "components/metrics/environment_recorder.h"
#include "components/metrics/metrics_pref_names.h"
#include "components/metrics/metrics_state_manager.h"
#include "components/metrics/test/test_metrics_provider.h"
#include "components/metrics/test/test_metrics_service_client.h"
#include "components/network_time/network_time_test_utils.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
#include "components/variations/active_field_trials.h"
#include "services/network/test/test_shared_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "base/win/current_module.h"
#endif
#if BUILDFLAG(IS_LINUX)
#include "base/nix/xdg_util.h"
#include "base/scoped_environment_variable_override.h"
#endif
namespace metrics {
namespace {
const char kClientId[] = …;
const int kSessionId = …;
class TestMetricsLog : public MetricsLog { … };
std::string GetExpectedHardwareClass() { … }
void UpdateNetworkTime(network_time::NetworkTimeTracker* network_time_tracker,
base::TickClock* tick_clock,
base::Time time) { … }
}
class MetricsLogTest : public testing::Test { … };
TEST_F(MetricsLogTest, FinalizedRecordId) { … }
TEST_F(MetricsLogTest, RecordId) { … }
TEST_F(MetricsLogTest, SessionHash) { … }
TEST_F(MetricsLogTest, LogType) { … }
TEST_F(MetricsLogTest, BasicRecord) { … }
TEST_F(MetricsLogTest, FinalizeLog) { … }
TEST_F(MetricsLogTest, Timestamps_InitialStabilityLog) { … }
TEST_F(MetricsLogTest, Timestamps_IndependentLog) { … }
TEST_F(MetricsLogTest, Timestamps_OngoingLog) { … }
TEST_F(MetricsLogTest,
Timestamps_OngoingLogLog_WithNetworkClockExists_AlwaysUnavailable) { … }
TEST_F(
MetricsLogTest,
Timestamps_OngoingLogLog_WithNetworkClockExists_UnavailableThenAvailable) { … }
TEST_F(MetricsLogTest,
Timestamps_OngoingLogLog_WithNetworkClockExists_AlwaysAvailable) { … }
TEST_F(MetricsLogTest, HistogramBucketFields) { … }
TEST_F(MetricsLogTest, HistogramSamplesCount) { … }
TEST_F(MetricsLogTest, RecordEnvironment) { … }
TEST_F(MetricsLogTest, RecordEnvironmentExtendedStable) { … }
TEST_F(MetricsLogTest, RecordEnvironmentEnableDefault) { … }
TEST_F(MetricsLogTest, InitialLogStabilityMetrics) { … }
TEST_F(MetricsLogTest, OngoingLogStabilityMetrics) { … }
TEST_F(MetricsLogTest, ChromeChannelWrittenToProtobuf) { … }
TEST_F(MetricsLogTest, ProductNotSetIfDefault) { … }
TEST_F(MetricsLogTest, ProductSetIfNotDefault) { … }
TEST_F(MetricsLogTest, ToInstallerPackage) { … }
}