Index: chrome/browser/metrics/metrics_log_unittest.cc |
diff --git a/chrome/browser/metrics/metrics_log_unittest.cc b/chrome/browser/metrics/metrics_log_unittest.cc |
index 4624364111d7dc7de79fa4fee4fbc7a17b073329..dd241de7241bd9d8d9844f3e3bc25185e351589c 100644 |
--- a/chrome/browser/metrics/metrics_log_unittest.cc |
+++ b/chrome/browser/metrics/metrics_log_unittest.cc |
@@ -89,12 +89,32 @@ content::WebPluginInfo CreateFakePluginInfo( |
} |
#endif // defined(ENABLE_PLUGINS) |
+#if defined(OS_CHROMEOS) |
+class TestMetricsLogChromeOS : public MetricsLogChromeOS { |
+ public: |
+ explicit TestMetricsLogChromeOS( |
+ metrics::SystemProfileProto* system_profile) |
+ : MetricsLogChromeOS(system_profile) { |
+ } |
+ |
+ protected: |
+ // Don't touch bluetooth information, as it won't be correctly initialized. |
+ virtual void WriteBluetoothProto( |
+ metrics::SystemProfileProto::Hardware* hardware) OVERRIDE { |
+ } |
+}; |
+#endif // OS_CHROMEOS |
+ |
class TestMetricsLog : public MetricsLog { |
public: |
TestMetricsLog(const std::string& client_id, int session_id) |
: MetricsLog(client_id, session_id), |
prefs_(&scoped_prefs_), |
brand_for_testing_(kBrandForTesting) { |
+#if defined(OS_CHROMEOS) |
+ metrics_log_chromeos_.reset(new TestMetricsLogChromeOS( |
+ MetricsLog::uma_proto()->mutable_system_profile())); |
+#endif // OS_CHROMEOS |
chrome::RegisterLocalState(scoped_prefs_.registry()); |
InitPrefs(); |
} |
@@ -106,6 +126,10 @@ class TestMetricsLog : public MetricsLog { |
: MetricsLog(client_id, session_id), |
prefs_(prefs), |
brand_for_testing_(kBrandForTesting) { |
+#if defined(OS_CHROMEOS) |
+ metrics_log_chromeos_.reset(new TestMetricsLogChromeOS( |
+ MetricsLog::uma_proto()->mutable_system_profile())); |
+#endif // OS_CHROMEOS |
InitPrefs(); |
} |
virtual ~TestMetricsLog() {} |
@@ -157,10 +181,6 @@ class TestMetricsLog : public MetricsLog { |
return kScreenCount; |
} |
- virtual void WriteBluetoothProto( |
- metrics::SystemProfileProto::Hardware* hardware) OVERRIDE { |
- } |
- |
// Scoped PrefsService, which may not be used if |prefs_ != &scoped_prefs|. |
TestingPrefServiceSimple scoped_prefs_; |
// Weak pointer to the PrefsService used by this log. |