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

Unified Diff: device/bluetooth/bluetooth_adapter_win_unittest.cc

Issue 2296923003: Make TestSimpleTaskRunner thread-safe. (Closed)
Patch Set: fix asan error Created 4 years, 3 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_win_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_win_unittest.cc b/device/bluetooth/bluetooth_adapter_win_unittest.cc
index d57a767f45fd695df6cf82bfbb720a9d3781ac87..02b2f9484706972aa3d789155e2eac6382f02ab8 100644
--- a/device/bluetooth/bluetooth_adapter_win_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_win_unittest.cc
@@ -169,7 +169,7 @@ TEST_F(BluetoothAdapterWinTest, SingleStartDiscovery) {
base::Unretained(this)),
DiscoverySessionErrorCallback());
EXPECT_TRUE(ui_task_runner_->GetPendingTasks().empty());
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
EXPECT_FALSE(adapter_->IsDiscovering());
EXPECT_EQ(0, num_start_discovery_callbacks_);
adapter_win_->DiscoveryStarted(true);
@@ -201,7 +201,7 @@ TEST_F(BluetoothAdapterWinTest, MultipleStartDiscoveries) {
&BluetoothAdapterWinTest::IncrementNumStartDiscoveryCallbacks,
base::Unretained(this)),
DiscoverySessionErrorCallback());
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
}
EXPECT_TRUE(ui_task_runner_->GetPendingTasks().empty());
EXPECT_FALSE(adapter_->IsDiscovering());
@@ -317,7 +317,7 @@ TEST_F(BluetoothAdapterWinTest, MultipleStopDiscoveries) {
base::Bind(&BluetoothAdapterWinTest::IncrementNumStopDiscoveryCallbacks,
base::Unretained(this)),
DiscoverySessionErrorCallback());
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
EXPECT_TRUE(adapter_->IsDiscovering());
adapter_win_->DiscoveryStopped();
ui_task_runner_->RunPendingTasks();
@@ -348,7 +348,7 @@ TEST_F(BluetoothAdapterWinTest,
base::Bind(&BluetoothAdapterWinTest::IncrementNumStopDiscoveryCallbacks,
base::Unretained(this)),
DiscoverySessionErrorCallback());
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
}
TEST_F(BluetoothAdapterWinTest,
@@ -371,7 +371,7 @@ TEST_F(BluetoothAdapterWinTest, StartDiscoveryBeforeDiscoveryStopped) {
CallAddDiscoverySession(base::Closure(), DiscoverySessionErrorCallback());
bluetooth_task_runner_->ClearPendingTasks();
adapter_win_->DiscoveryStopped();
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
}
TEST_F(BluetoothAdapterWinTest, StopDiscoveryWithoutStartDiscovery) {
@@ -388,7 +388,7 @@ TEST_F(BluetoothAdapterWinTest, StopDiscoveryBeforeDiscoveryStarted) {
CallRemoveDiscoverySession(base::Closure(), DiscoverySessionErrorCallback());
bluetooth_task_runner_->ClearPendingTasks();
adapter_win_->DiscoveryStarted(true);
- EXPECT_EQ(1u, bluetooth_task_runner_->GetPendingTasks().size());
+ EXPECT_EQ(1u, bluetooth_task_runner_->NumPendingTasks());
}
TEST_F(BluetoothAdapterWinTest, StartAndStopBeforeDiscoveryStarted) {

Powered by Google App Engine
This is Rietveld 408576698