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

Unified Diff: device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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/bluez/bluetooth_adapter_profile_bluez_unittest.cc
diff --git a/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc
index 7b487979fb1639e39a1f017a2c801f7eae28c8f7..69a20d86f7e0e00072169466eec568cbf9f16a4b 100644
--- a/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc
+++ b/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_uuid.h"
@@ -58,7 +59,7 @@ class BluetoothAdapterProfileBlueZTest : public testing::Test {
device::BluetoothAdapterFactory::GetAdapter(
base::Bind(&BluetoothAdapterProfileBlueZTest::AdapterCallback,
base::Unretained(this)));
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
ASSERT_TRUE(adapter_.get() != nullptr);
ASSERT_TRUE(adapter_->IsInitialized());
ASSERT_TRUE(adapter_->IsPresent());
@@ -181,7 +182,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, DelegateCount) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(profile_);
EXPECT_EQ(1U, success_callback_count_);
@@ -218,7 +219,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, BlackHole) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(profile_);
EXPECT_EQ(1U, success_callback_count_);
@@ -232,7 +233,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, BlackHole) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(1U, success_callback_count_);
EXPECT_EQ(1U, error_callback_count_);
@@ -253,7 +254,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, Routing) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
ASSERT_TRUE(profile_);
ASSERT_EQ(1U, success_callback_count_);
@@ -274,7 +275,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, Routing) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(2U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -289,7 +290,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, Routing) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(3U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -305,7 +306,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, Routing) {
base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(4U, success_callback_count_);
EXPECT_EQ(0U, error_callback_count_);
@@ -339,7 +340,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, SimultaneousRegister) {
base::Bind(&BluetoothAdapterProfileBlueZTest::BasicErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(profile_user_ptr_);
EXPECT_EQ(2U, success_callback_count_);
@@ -350,7 +351,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, SimultaneousRegister) {
adapter->ReleaseProfile(fake_delegate_autopair_.device_path_,
profile_user_ptr_);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(BluetoothAdapterProfileBlueZTest, SimultaneousRegisterFail) {
@@ -380,7 +381,7 @@ TEST_F(BluetoothAdapterProfileBlueZTest, SimultaneousRegisterFail) {
base::Bind(&BluetoothAdapterProfileBlueZTest::BasicErrorCallback,
base::Unretained(this)));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(profile_user_ptr_);
EXPECT_EQ(0U, success_callback_count_);
« no previous file with comments | « device/battery/battery_status_manager_linux.cc ('k') | device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698