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()15TestMetricsServiceClient::TestMetricsServiceClient() 16 : version_string_("5.0.322.0-64-devel") { 17 } 18 ~TestMetricsServiceClient()19TestMetricsServiceClient::~TestMetricsServiceClient() { 20 } 21 SetMetricsClientId(const std::string & client_id)22void TestMetricsServiceClient::SetMetricsClientId( 23 const std::string& client_id) { 24 client_id_ = client_id; 25 } 26 IsOffTheRecordSessionActive()27bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { 28 return false; 29 } 30 GetApplicationLocale()31std::string TestMetricsServiceClient::GetApplicationLocale() { 32 return "en-US"; 33 } 34 GetBrand(std::string * brand_code)35bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { 36 *brand_code = kBrandForTesting; 37 return true; 38 } 39 GetChannel()40SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { 41 return SystemProfileProto::CHANNEL_BETA; 42 } 43 GetVersionString()44std::string TestMetricsServiceClient::GetVersionString() { 45 return version_string_; 46 } 47 OnLogUploadComplete()48void TestMetricsServiceClient::OnLogUploadComplete() { 49 } 50 StartGatheringMetrics(const base::Closure & done_callback)51void TestMetricsServiceClient::StartGatheringMetrics( 52 const base::Closure& done_callback) { 53 done_callback.Run(); 54 } 55 CollectFinalMetrics(const base::Closure & done_callback)56void TestMetricsServiceClient::CollectFinalMetrics( 57 const base::Closure& done_callback) { 58 done_callback.Run(); 59 } 60 CreateUploader(const std::string & server_url,const std::string & mime_type,const base::Callback<void (int)> & on_upload_complete)61scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( 62 const std::string& server_url, 63 const std::string& mime_type, 64 const base::Callback<void(int)>& on_upload_complete) { 65 return scoped_ptr<MetricsLogUploader>(); 66 } 67 68 } // namespace metrics 69