• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "components/metrics/test_metrics_service_client.h"
6 
7 #include "base/callback.h"
8 #include "components/metrics/metrics_log_uploader.h"
9 
10 namespace metrics {
11 
12 // static
13 const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing";
14 
TestMetricsServiceClient()15 TestMetricsServiceClient::TestMetricsServiceClient()
16     : install_date_(0),
17       version_string_("5.0.322.0-64-devel") {
18 }
19 
~TestMetricsServiceClient()20 TestMetricsServiceClient::~TestMetricsServiceClient() {
21 }
22 
SetClientID(const std::string & client_id)23 void TestMetricsServiceClient::SetClientID(const std::string& client_id) {
24   client_id_ = client_id;
25 }
26 
IsOffTheRecordSessionActive()27 bool TestMetricsServiceClient::IsOffTheRecordSessionActive() {
28   return false;
29 }
30 
GetApplicationLocale()31 std::string TestMetricsServiceClient::GetApplicationLocale() {
32   return "en-US";
33 }
34 
GetBrand(std::string * brand_code)35 bool TestMetricsServiceClient::GetBrand(std::string* brand_code) {
36   *brand_code = kBrandForTesting;
37   return true;
38 }
39 
GetChannel()40 SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() {
41   return SystemProfileProto::CHANNEL_BETA;
42 }
43 
GetVersionString()44 std::string TestMetricsServiceClient::GetVersionString() {
45   return version_string_;
46 }
47 
GetInstallDate()48 int64 TestMetricsServiceClient::GetInstallDate() {
49   return install_date_;
50 }
51 
OnLogUploadComplete()52 void TestMetricsServiceClient::OnLogUploadComplete() {
53 }
54 
StartGatheringMetrics(const base::Closure & done_callback)55 void TestMetricsServiceClient::StartGatheringMetrics(
56     const base::Closure& done_callback) {
57   done_callback.Run();
58 }
59 
CollectFinalMetrics(const base::Closure & done_callback)60 void TestMetricsServiceClient::CollectFinalMetrics(
61     const base::Closure& done_callback) {
62   done_callback.Run();
63 }
64 
CreateUploader(const std::string & server_url,const std::string & mime_type,const base::Callback<void (int)> & on_upload_complete)65 scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader(
66     const std::string& server_url,
67     const std::string& mime_type,
68     const base::Callback<void(int)>& on_upload_complete) {
69   return scoped_ptr<MetricsLogUploader>();
70 }
71 
72 }  // namespace metrics
73