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

Unified Diff: device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created IsBluetoothSupported in BluetoothEventRouter to fix browser_tests. Created 7 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: device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc b/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc
index ac7677b8b4c1cfa261b8794175ad252757671653..bf5a04befd2f553d8f04d7dc85061c359ddfefbf 100644
--- a/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc
@@ -52,8 +52,10 @@ class BluetoothAdapterDevicesChromeOsTest : public testing::Test {
EXPECT_CALL(*mock_adapter_client_, AddObserver(_))
.Times(1);
- adapter_ = BluetoothAdapterFactory::DefaultAdapter();
- ASSERT_TRUE(adapter_.get() != NULL);
+ BluetoothAdapterFactory::RunCallbackOnAdapterReady(
+ base::Bind(&BluetoothAdapterDevicesChromeOsTest::SetAdapter,
+ base::Unretained(this)));
+ ASSERT_TRUE(adapter_ != NULL);
// Call the adapter callback;
// BluetoothAdapterClient::GetProperties will be called once to obtain
@@ -96,6 +98,10 @@ class BluetoothAdapterDevicesChromeOsTest : public testing::Test {
DBusThreadManager::Shutdown();
}
+ void SetAdapter(scoped_refptr<device::BluetoothAdapter> adapter) {
+ adapter_ = adapter;
+ }
+
protected:
MockBluetoothManagerClient* mock_manager_client_;
MockBluetoothAdapterClient* mock_adapter_client_;
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos_unittest.cc ('k') | device/bluetooth/bluetooth_adapter_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698