OLD | NEW |
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_discovery_session_outcome.h" | 10 #include "device/bluetooth/bluetooth_discovery_session_outcome.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 [[[mock_peripheral stub] | 70 [[[mock_peripheral stub] |
71 andReturn:[[uuid_class performSelector:@selector(UUID)] | 71 andReturn:[[uuid_class performSelector:@selector(UUID)] |
72 performSelector:@selector(initWithUUIDString:) | 72 performSelector:@selector(initWithUUIDString:) |
73 withObject:identifier]] identifier]; | 73 withObject:identifier]] identifier]; |
74 | 74 |
75 return mock_peripheral; | 75 return mock_peripheral; |
76 } | 76 } |
77 | 77 |
78 NSDictionary* CreateAdvertisementData() { | 78 NSDictionary* CreateAdvertisementData() { |
79 NSDictionary* advertisement_data = @{ | 79 NSDictionary* advertisement_data = @{ |
80 @"CBAdvertisementDataIsConnectable" : @(YES), | 80 CBAdvertisementDataIsConnectable : @(YES), |
81 @"CBAdvertisementDataServiceDataKey" : [NSDictionary dictionary], | 81 CBAdvertisementDataServiceDataKey : [NSDictionary dictionary], |
82 }; | 82 }; |
83 [advertisement_data retain]; | 83 [advertisement_data retain]; |
84 return advertisement_data; | 84 return advertisement_data; |
85 } | 85 } |
86 | 86 |
87 std::string GetHashAddress(CBPeripheral* peripheral) { | 87 std::string GetHashAddress(CBPeripheral* peripheral) { |
88 return BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); | 88 return BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); |
89 } | 89 } |
90 | 90 |
91 void SetDeviceTimeGreaterThanTimeout(BluetoothLowEnergyDeviceMac* device) { | 91 void SetDeviceTimeGreaterThanTimeout(BluetoothLowEnergyDeviceMac* device) { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 EXPECT_EQ(1, NumDevices()); | 315 EXPECT_EQ(1, NumDevices()); |
316 EXPECT_TRUE(DevicePresent(mock_peripheral)); | 316 EXPECT_TRUE(DevicePresent(mock_peripheral)); |
317 | 317 |
318 // Check that object pointed to by |device| is deleted by the adapter. | 318 // Check that object pointed to by |device| is deleted by the adapter. |
319 RemoveTimedOutDevices(); | 319 RemoveTimedOutDevices(); |
320 EXPECT_EQ(0, NumDevices()); | 320 EXPECT_EQ(0, NumDevices()); |
321 EXPECT_FALSE(DevicePresent(mock_peripheral)); | 321 EXPECT_FALSE(DevicePresent(mock_peripheral)); |
322 } | 322 } |
323 | 323 |
324 } // namespace device | 324 } // namespace device |
OLD | NEW |