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

Unified Diff: chrome/browser/metrics/metrics_service_unittest.cc

Issue 146913005: Factor ChromeOS specific code out of MetricsLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address asvitkine's comments (round 2). Created 6 years, 11 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
Index: chrome/browser/metrics/metrics_service_unittest.cc
diff --git a/chrome/browser/metrics/metrics_service_unittest.cc b/chrome/browser/metrics/metrics_service_unittest.cc
index 163be783e2227534e3da4a19a44bbba12282194e..49c069ce9a9c4fc5805e3fe31f7f6ed88329f5de 100644
--- a/chrome/browser/metrics/metrics_service_unittest.cc
+++ b/chrome/browser/metrics/metrics_service_unittest.cc
@@ -19,6 +19,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/size.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/metrics/metrics_log_chromeos.h"
+#endif // OS_CHROMEOS
+
namespace {
class TestMetricsService : public MetricsService {
@@ -34,10 +38,30 @@ class TestMetricsService : public MetricsService {
DISALLOW_COPY_AND_ASSIGN(TestMetricsService);
};
+#if defined(OS_CHROMEOS)
+class TestMetricsLogChromeOS : public MetricsLogChromeOS {
+ public:
+ explicit TestMetricsLogChromeOS(
+ metrics::ChromeUserMetricsExtension* uma_proto)
+ : MetricsLogChromeOS(uma_proto) {
+ }
+
+ protected:
+ // Don't touch bluetooth information, as it won't be correctly initialized.
+ virtual void WriteBluetoothProto() OVERRIDE {
+ }
+};
+#endif // OS_CHROMEOS
+
class TestMetricsLog : public MetricsLog {
public:
TestMetricsLog(const std::string& client_id, int session_id)
- : MetricsLog(client_id, session_id) {}
+ : MetricsLog(client_id, session_id) {
+#if defined(OS_CHROMEOS)
+ metrics_log_chromeos_.reset(new TestMetricsLogChromeOS(
+ MetricsLog::uma_proto()));
+#endif // OS_CHROMEOS
+ }
virtual ~TestMetricsLog() {}
private:
@@ -53,10 +77,6 @@ class TestMetricsLog : public MetricsLog {
return 1;
}
- virtual void WriteBluetoothProto(
- metrics::SystemProfileProto::Hardware* hardware) OVERRIDE {
- }
-
DISALLOW_COPY_AND_ASSIGN(TestMetricsLog);
};

Powered by Google App Engine
This is Rietveld 408576698