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

Side by Side Diff: device/bluetooth/bluetooth_adapter_mac_unittest.mm

Issue 2338733002: Use TestSimpleTaskRunner::HasPendingTask instead of GetPendingTasks().empty() (Closed)
Patch Set: +bluetooth_adapter_win_unittest.cc 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_adapter_mac.h" 5 #include "device/bluetooth/bluetooth_adapter_mac.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 // Owned by |adapter_mac_|. 142 // Owned by |adapter_mac_|.
143 base::scoped_nsobject<MockCentralManager> mock_central_manager_; 143 base::scoped_nsobject<MockCentralManager> mock_central_manager_;
144 144
145 int callback_count_; 145 int callback_count_;
146 int error_callback_count_; 146 int error_callback_count_;
147 }; 147 };
148 148
149 TEST_F(BluetoothAdapterMacTest, Poll) { 149 TEST_F(BluetoothAdapterMacTest, Poll) {
150 PollAdapter(); 150 PollAdapter();
151 EXPECT_FALSE(ui_task_runner_->GetPendingTasks().empty()); 151 EXPECT_TRUE(ui_task_runner_->HasPendingTask());
152 } 152 }
153 153
154 TEST_F(BluetoothAdapterMacTest, AddDiscoverySessionWithLowEnergyFilter) { 154 TEST_F(BluetoothAdapterMacTest, AddDiscoverySessionWithLowEnergyFilter) {
155 if (!SetMockCentralManager(CBCentralManagerStatePoweredOn)) 155 if (!SetMockCentralManager(CBCentralManagerStatePoweredOn))
156 return; 156 return;
157 EXPECT_EQ(0, [mock_central_manager_ scanForPeripheralsCallCount]); 157 EXPECT_EQ(0, [mock_central_manager_ scanForPeripheralsCallCount]);
158 EXPECT_EQ(0, NumDiscoverySessions()); 158 EXPECT_EQ(0, NumDiscoverySessions());
159 159
160 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter( 160 std::unique_ptr<BluetoothDiscoveryFilter> discovery_filter(
161 new BluetoothDiscoveryFilter(BLUETOOTH_TRANSPORT_LE)); 161 new BluetoothDiscoveryFilter(BLUETOOTH_TRANSPORT_LE));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 base::scoped_nsobject<NSDictionary> advertisement_data(AdvertisementData()); 253 base::scoped_nsobject<NSDictionary> advertisement_data(AdvertisementData());
254 254
255 EXPECT_EQ(0, NumDevices()); 255 EXPECT_EQ(0, NumDevices());
256 EXPECT_FALSE(DevicePresent(mock_peripheral)); 256 EXPECT_FALSE(DevicePresent(mock_peripheral));
257 LowEnergyDeviceUpdated(mock_peripheral, advertisement_data, kTestRssi); 257 LowEnergyDeviceUpdated(mock_peripheral, advertisement_data, kTestRssi);
258 EXPECT_EQ(1, NumDevices()); 258 EXPECT_EQ(1, NumDevices());
259 EXPECT_TRUE(DevicePresent(mock_peripheral)); 259 EXPECT_TRUE(DevicePresent(mock_peripheral));
260 } 260 }
261 261
262 } // namespace device 262 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698