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

Unified Diff: components/metrics/test_metrics_service_client.h

Issue 290343005: Pass MetricsServiceClient into MetricsService, and create a simple stubbed TestMetricsServiceClient… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics.gypi ('k') | components/metrics/test_metrics_service_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/test_metrics_service_client.h
diff --git a/components/metrics/test_metrics_service_client.h b/components/metrics/test_metrics_service_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..bd8e981e420f1b4b3df99dc0e7a6d68da27a3982
--- /dev/null
+++ b/components/metrics/test_metrics_service_client.h
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_
+#define COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_
+
+#include "components/metrics/metrics_service_client.h"
+
+namespace metrics {
+
+// A simple concrete implementation of the MetricsServiceClient interface, for
+// use in tests.
+class TestMetricsServiceClient : public MetricsServiceClient {
+ public:
+ TestMetricsServiceClient();
+ virtual ~TestMetricsServiceClient();
+
+ // MetricsServiceClient:
+ virtual void SetClientID(const std::string& client_id) OVERRIDE;
+ virtual bool IsOffTheRecordSessionActive() OVERRIDE;
+ virtual std::string GetApplicationLocale() OVERRIDE;
+ virtual bool GetBrand(std::string* brand_code) OVERRIDE;
+ virtual SystemProfileProto::Channel GetChannel() OVERRIDE;
+ virtual std::string GetVersionString() OVERRIDE;
+
+ const std::string& get_client_id() const { return client_id_; }
+
+ private:
+ std::string client_id_;
+};
+
+} // namespace metrics
+
+#endif // COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_
« no previous file with comments | « components/metrics.gypi ('k') | components/metrics/test_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698