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

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

Issue 1276353005: Planned implementation of CreateGattConnection Base URL: https://chromium.googlesource.com/chromium/src.git@adapimpl-simple
Patch Set: Created 5 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 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/test/test_simple_task_runner.h" 6 #include "base/test/test_simple_task_runner.h"
7 #include "device/bluetooth/bluetooth_adapter.h" 7 #include "device/bluetooth/bluetooth_adapter.h"
8 #include "device/bluetooth/bluetooth_adapter_mac.h" 8 #include "device/bluetooth/bluetooth_adapter_mac.h"
9 #include "device/bluetooth/bluetooth_discovery_session.h" 9 #include "device/bluetooth/bluetooth_discovery_session.h"
10 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" 10 #include "device/bluetooth/bluetooth_low_energy_device_mac.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 295 }
296 296
297 TEST_F(BluetoothAdapterMacTest, UpdateDevicesRemovesLowEnergyDevice) { 297 TEST_F(BluetoothAdapterMacTest, UpdateDevicesRemovesLowEnergyDevice) {
298 base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID)); 298 base::scoped_nsobject<id> mock_peripheral(CreateMockPeripheral(kTestNSUUID));
299 if (mock_peripheral.get() == nil) 299 if (mock_peripheral.get() == nil)
300 return; 300 return;
301 base::scoped_nsobject<NSDictionary> advertisement_data( 301 base::scoped_nsobject<NSDictionary> advertisement_data(
302 CreateAdvertisementData()); 302 CreateAdvertisementData());
303 303
304 BluetoothLowEnergyDeviceMac* device = new BluetoothLowEnergyDeviceMac( 304 BluetoothLowEnergyDeviceMac* device = new BluetoothLowEnergyDeviceMac(
305 mock_peripheral, advertisement_data, kTestRssi); 305 mock_peripheral, advertisement_data, kTestRssi, adapter_.get(),
306 mock_central_manager_);
306 SetDeviceTimeGreaterThanTimeout(device); 307 SetDeviceTimeGreaterThanTimeout(device);
307 308
308 EXPECT_EQ(0, NumDevices()); 309 EXPECT_EQ(0, NumDevices());
309 AddLowEnergyDevice(device); 310 AddLowEnergyDevice(device);
310 EXPECT_EQ(1, NumDevices()); 311 EXPECT_EQ(1, NumDevices());
311 EXPECT_TRUE(DevicePresent(mock_peripheral)); 312 EXPECT_TRUE(DevicePresent(mock_peripheral));
312 313
313 // Check that object pointed to by |device| is deleted by the adapter. 314 // Check that object pointed to by |device| is deleted by the adapter.
314 RemoveTimedOutDevices(); 315 RemoveTimedOutDevices();
315 EXPECT_EQ(0, NumDevices()); 316 EXPECT_EQ(0, NumDevices());
316 EXPECT_FALSE(DevicePresent(mock_peripheral)); 317 EXPECT_FALSE(DevicePresent(mock_peripheral));
317 } 318 }
318 319
319 } // namespace device 320 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac.mm ('k') | device/bluetooth/bluetooth_gatt_connection_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698