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

Unified Diff: device/bluetooth/bluetooth_chromeos_unittest.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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: device/bluetooth/bluetooth_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_chromeos_unittest.cc b/device/bluetooth/bluetooth_chromeos_unittest.cc
index 3adaacb529403d516634deadb14076b14da8ad13..dea13221e6a0fa1a617c0b2035d22d22dbe55fd2 100644
--- a/device/bluetooth/bluetooth_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_chromeos_unittest.cc
@@ -5,7 +5,9 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/dbus/fake_bluetooth_adapter_client.h"
+#include "chromeos/dbus/fake_bluetooth_agent_manager_client.h"
#include "chromeos/dbus/fake_bluetooth_device_client.h"
+#include "chromeos/dbus/fake_bluetooth_input_client.h"
#include "chromeos/dbus/fake_dbus_thread_manager.h"
#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_adapter.h"
@@ -208,13 +210,19 @@ class TestPairingDelegate : public BluetoothDevice::PairingDelegate {
class BluetoothChromeOSTest : public testing::Test {
public:
virtual void SetUp() {
- fake_dbus_thread_manager_ = new FakeDBusThreadManager();
- DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager_);
-
- fake_bluetooth_adapter_client_ =
- fake_dbus_thread_manager_->fake_bluetooth_adapter_client();
- fake_bluetooth_device_client_ =
- fake_dbus_thread_manager_->fake_bluetooth_device_client();
+ FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager;
+ fake_bluetooth_adapter_client_ = new FakeBluetoothAdapterClient;
+ fake_dbus_thread_manager->SetBluetoothAdapterClient(
+ scoped_ptr<BluetoothAdapterClient>(fake_bluetooth_adapter_client_));
+ fake_bluetooth_device_client_ = new FakeBluetoothDeviceClient;
+ fake_dbus_thread_manager->SetBluetoothDeviceClient(
+ scoped_ptr<BluetoothDeviceClient>(fake_bluetooth_device_client_));
+ fake_dbus_thread_manager->SetBluetoothInputClient(
+ scoped_ptr<BluetoothInputClient>(new FakeBluetoothInputClient));
+ fake_dbus_thread_manager->SetBluetoothAgentManagerClient(
+ scoped_ptr<BluetoothAgentManagerClient>(
+ new FakeBluetoothAgentManagerClient));
+ DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
callback_count_ = 0;
error_callback_count_ = 0;
@@ -312,7 +320,6 @@ class BluetoothChromeOSTest : public testing::Test {
protected:
FakeBluetoothAdapterClient* fake_bluetooth_adapter_client_;
FakeBluetoothDeviceClient* fake_bluetooth_device_client_;
- FakeDBusThreadManager* fake_dbus_thread_manager_;
scoped_refptr<BluetoothAdapter> adapter_;
int callback_count_;
« no previous file with comments | « chromeos/network/network_configuration_handler_unittest.cc ('k') | device/bluetooth/bluetooth_profile_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698