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

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

Issue 1410223003: bluetooth: mac: Fix incorrect use of AdvertisementData dictionary strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-merge-uuids-
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | device/bluetooth/test/bluetooth_test_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/test/bluetooth_test_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698