test_metrics_service_client.cc revision 46d4c2bc3267f3f028f39e7e311b0f89aba2e4fd
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
10namespace metrics {
11
12// static
13const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing";
14
15TestMetricsServiceClient::TestMetricsServiceClient()
16    : install_date_(0),
17      version_string_("5.0.322.0-64-devel") {
18}
19
20TestMetricsServiceClient::~TestMetricsServiceClient() {
21}
22
23void TestMetricsServiceClient::SetClientID(const std::string& client_id) {
24  client_id_ = client_id;
25}
26
27bool TestMetricsServiceClient::IsOffTheRecordSessionActive() {
28  return false;
29}
30
31std::string TestMetricsServiceClient::GetApplicationLocale() {
32  return "en-US";
33}
34
35bool TestMetricsServiceClient::GetBrand(std::string* brand_code) {
36  *brand_code = kBrandForTesting;
37  return true;
38}
39
40SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() {
41  return SystemProfileProto::CHANNEL_BETA;
42}
43
44std::string TestMetricsServiceClient::GetVersionString() {
45  return version_string_;
46}
47
48int64 TestMetricsServiceClient::GetInstallDate() {
49  return install_date_;
50}
51
52void TestMetricsServiceClient::OnLogUploadComplete() {
53}
54
55void TestMetricsServiceClient::StartGatheringMetrics(
56    const base::Closure& done_callback) {
57  done_callback.Run();
58}
59
60void TestMetricsServiceClient::CollectFinalMetrics(
61    const base::Closure& done_callback) {
62  done_callback.Run();
63}
64
65scoped_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