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

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

Issue 14109028: Bluetooth: gather usage metrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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.cc ('k') | chrome/common/metrics/proto/system_profile.proto » ('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 946dbb72db29679658b793ce04030685a70712b4..2b5db299f8dbc8dd2ce92a6968b8bcd7a29bc094 100644
--- a/chrome/browser/metrics/metrics_log_unittest.cc
+++ b/chrome/browser/metrics/metrics_log_unittest.cc
@@ -5,6 +5,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/port.h"
#include "base/prefs/pref_service.h"
@@ -30,6 +31,11 @@
#include "ui/gfx/size.h"
#include "webkit/plugins/webplugininfo.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/chromeos_switches.h"
+#include "chromeos/dbus/mock_dbus_thread_manager_without_gmock.h"
+#endif // OS_CHROMEOS
+
using base::TimeDelta;
using metrics::ProfilerEventProto;
using tracked_objects::ProcessDataSnapshot;
@@ -151,17 +157,39 @@ class MetricsLogTest : public testing::Test {
// of this call.
}
+ virtual void SetUp() OVERRIDE {
+#if defined(OS_CHROMEOS)
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableExperimentalBluetooth))
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ chromeos::switches::kEnableExperimentalBluetooth);
+
+ mock_dbus_thread_manager_ =
+ new chromeos::MockDBusThreadManagerWithoutGMock();
+ chromeos::DBusThreadManager::InitializeForTesting(
+ mock_dbus_thread_manager_);
+#endif // OS_CHROMEOS
+ }
+
virtual void TearDown() OVERRIDE {
// Drain the blocking pool from PostTaskAndReply executed by
// MetrticsLog.network_observer_.
content::BrowserThread::GetBlockingPool()->FlushForTesting();
content::RunAllPendingInMessageLoop();
+
+#if defined(OS_CHROMEOS)
+ chromeos::DBusThreadManager::Shutdown();
+#endif // OS_CHROMEOS
}
private:
// This is necessary because eventually some tests call base::RepeatingTimer
// functions and a message loop is required for that.
MessageLoop message_loop_;
+
+#if defined(OS_CHROMEOS)
+ chromeos::MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager_;
+#endif // OS_CHROMEOS
};
TEST_F(MetricsLogTest, RecordEnvironment) {
« no previous file with comments | « chrome/browser/metrics/metrics_log.cc ('k') | chrome/common/metrics/proto/system_profile.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698