Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: chrome/browser/metrics/metrics_log_unittest.cc

Issue 312583002: Move MetricsStateManager into the Metrics component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698