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

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

Issue 146913005: Factor ChromeOS specific code out of MetricsLog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address rtenneti nits. 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
« no previous file with comments | « chrome/browser/metrics/metrics_log_chromeos.cc ('k') | chrome/browser/metrics/metrics_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c0dea96b7f63110176073cefbee4caa5a05528d9 100644
--- a/chrome/browser/metrics/metrics_log_unittest.cc
+++ b/chrome/browser/metrics/metrics_log_unittest.cc
@@ -41,6 +41,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/fake_user_manager.h"
#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chrome/browser/metrics/metrics_log_chromeos.h"
#endif // OS_CHROMEOS
using base::TimeDelta;
@@ -89,12 +90,31 @@ content::WebPluginInfo CreateFakePluginInfo(
}
#endif // defined(ENABLE_PLUGINS)
+#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),
prefs_(&scoped_prefs_),
brand_for_testing_(kBrandForTesting) {
+#if defined(OS_CHROMEOS)
+ metrics_log_chromeos_.reset(new TestMetricsLogChromeOS(
+ MetricsLog::uma_proto()));
+#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()));
+#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.
« no previous file with comments | « chrome/browser/metrics/metrics_log_chromeos.cc ('k') | chrome/browser/metrics/metrics_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698