| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return *MetricsLog::uma_proto(); | 76 return *MetricsLog::uma_proto(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 const metrics::SystemProfileProto& system_profile() const { | 79 const metrics::SystemProfileProto& system_profile() const { |
| 80 return uma_proto().system_profile(); | 80 return uma_proto().system_profile(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 void InitPrefs() { | 84 void InitPrefs() { |
| 85 prefs_->SetInt64(prefs::kInstallDate, kInstallDate); | 85 prefs_->SetInt64(prefs::kInstallDate, kInstallDate); |
| 86 prefs_->SetString(prefs::kMetricsReportingEnabledTimestamp, | 86 prefs_->SetString(metrics::prefs::kMetricsReportingEnabledTimestamp, |
| 87 base::Int64ToString(kEnabledDate)); | 87 base::Int64ToString(kEnabledDate)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void GetFieldTrialIds( | 90 virtual void GetFieldTrialIds( |
| 91 std::vector<variations::ActiveGroupId>* field_trial_ids) const | 91 std::vector<variations::ActiveGroupId>* field_trial_ids) const |
| 92 OVERRIDE { | 92 OVERRIDE { |
| 93 ASSERT_TRUE(field_trial_ids->empty()); | 93 ASSERT_TRUE(field_trial_ids->empty()); |
| 94 | 94 |
| 95 for (size_t i = 0; i < arraysize(kFieldTrialIds); ++i) { | 95 for (size_t i = 0; i < arraysize(kFieldTrialIds); ++i) { |
| 96 field_trial_ids->push_back(kFieldTrialIds[i]); | 96 field_trial_ids->push_back(kFieldTrialIds[i]); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 EXPECT_FALSE(stability.has_debugger_present_count()); | 301 EXPECT_FALSE(stability.has_debugger_present_count()); |
| 302 EXPECT_FALSE(stability.has_debugger_not_present_count()); | 302 EXPECT_FALSE(stability.has_debugger_not_present_count()); |
| 303 } | 303 } |
| 304 | 304 |
| 305 TEST_F(MetricsLogTest, ChromeChannelWrittenToProtobuf) { | 305 TEST_F(MetricsLogTest, ChromeChannelWrittenToProtobuf) { |
| 306 metrics::TestMetricsServiceClient client; | 306 metrics::TestMetricsServiceClient client; |
| 307 TestMetricsLog log( | 307 TestMetricsLog log( |
| 308 "user@test.com", kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); | 308 "user@test.com", kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); |
| 309 EXPECT_TRUE(log.uma_proto().system_profile().has_channel()); | 309 EXPECT_TRUE(log.uma_proto().system_profile().has_channel()); |
| 310 } | 310 } |
| OLD | NEW |