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

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: 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return *MetricsLog::uma_proto(); 81 return *MetricsLog::uma_proto();
82 } 82 }
83 83
84 const metrics::SystemProfileProto& system_profile() const { 84 const metrics::SystemProfileProto& system_profile() const {
85 return uma_proto().system_profile(); 85 return uma_proto().system_profile();
86 } 86 }
87 87
88 private: 88 private:
89 void InitPrefs() { 89 void InitPrefs() {
90 prefs_->SetInt64(prefs::kInstallDate, kInstallDate); 90 prefs_->SetInt64(prefs::kInstallDate, kInstallDate);
91 prefs_->SetString(prefs::kMetricsReportingEnabledTimestamp, 91 prefs_->SetString(metrics::prefs::kMetricsReportingEnabledTimestamp,
92 base::Int64ToString(kEnabledDate)); 92 base::Int64ToString(kEnabledDate));
93 } 93 }
94 94
95 virtual void GetFieldTrialIds( 95 virtual void GetFieldTrialIds(
96 std::vector<variations::ActiveGroupId>* field_trial_ids) const 96 std::vector<variations::ActiveGroupId>* field_trial_ids) const
97 OVERRIDE { 97 OVERRIDE {
98 ASSERT_TRUE(field_trial_ids->empty()); 98 ASSERT_TRUE(field_trial_ids->empty());
99 99
100 for (size_t i = 0; i < arraysize(kFieldTrialIds); ++i) { 100 for (size_t i = 0; i < arraysize(kFieldTrialIds); ++i) {
101 field_trial_ids->push_back(kFieldTrialIds[i]); 101 field_trial_ids->push_back(kFieldTrialIds[i]);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 tracked_object->process_type()); 476 tracked_object->process_type());
477 } 477 }
478 } 478 }
479 479
480 TEST_F(MetricsLogTest, ChromeChannelWrittenToProtobuf) { 480 TEST_F(MetricsLogTest, ChromeChannelWrittenToProtobuf) {
481 metrics::TestMetricsServiceClient client; 481 metrics::TestMetricsServiceClient client;
482 TestMetricsLog log( 482 TestMetricsLog log(
483 "user@test.com", kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_); 483 "user@test.com", kSessionId, MetricsLog::ONGOING_LOG, &client, &prefs_);
484 EXPECT_TRUE(log.uma_proto().system_profile().has_channel()); 484 EXPECT_TRUE(log.uma_proto().system_profile().has_channel());
485 } 485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698