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

Side by Side Diff: device/bluetooth/test/bluetooth_test_mac.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 | « device/bluetooth/bluetooth_adapter_mac_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/bluetooth_test_mac.h" 5 #include "device/bluetooth/test/bluetooth_test_mac.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "device/bluetooth/bluetooth_adapter_mac.h" 8 #include "device/bluetooth/bluetooth_adapter_mac.h"
9 #include "device/bluetooth/test/mock_bluetooth_central_manager_mac.h" 9 #include "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
10 #include "device/bluetooth/test/test_bluetooth_adapter_observer.h" 10 #include "device/bluetooth/test/test_bluetooth_adapter_observer.h"
(...skipping 22 matching lines...) Expand all
33 performSelector:@selector(identifier)]; 33 performSelector:@selector(identifier)];
34 [[[mock_peripheral stub] 34 [[[mock_peripheral stub]
35 andReturn:[NSString stringWithUTF8String:BluetoothTest::kTestDeviceName 35 andReturn:[NSString stringWithUTF8String:BluetoothTest::kTestDeviceName
36 .c_str()]] name]; 36 .c_str()]] name];
37 return mock_peripheral; 37 return mock_peripheral;
38 } 38 }
39 39
40 NSDictionary* CreateAdvertisementData(NSString* name, NSArray* uuids) { 40 NSDictionary* CreateAdvertisementData(NSString* name, NSArray* uuids) {
41 NSMutableDictionary* advertisement_data = 41 NSMutableDictionary* advertisement_data =
42 [NSMutableDictionary dictionaryWithDictionary:@{ 42 [NSMutableDictionary dictionaryWithDictionary:@{
43 @"CBAdvertisementDataLocalNameKey" : name, 43 CBAdvertisementDataLocalNameKey : name,
44 @"CBAdvertisementDataServiceDataKey" : [NSDictionary dictionary], 44 CBAdvertisementDataServiceDataKey : [NSDictionary dictionary],
45 @"CBAdvertisementDataIsConnectable" : @(YES), 45 CBAdvertisementDataIsConnectable : @(YES),
46 }]; 46 }];
47 if (uuids) 47 if (uuids)
48 [advertisement_data setObject:uuids 48 [advertisement_data setObject:uuids
49 forKey:@"CBAdvertisementDataServiceUUIDsKey"]; 49 forKey:CBAdvertisementDataServiceUUIDsKey];
50 return advertisement_data; 50 return advertisement_data;
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 // UUID1 hashes to kTestDeviceAddress1, and UUID2 to kTestDeviceAddress2. 55 // UUID1 hashes to kTestDeviceAddress1, and UUID2 to kTestDeviceAddress2.
56 const std::string BluetoothTestMac::kTestPeripheralUUID1 = 56 const std::string BluetoothTestMac::kTestPeripheralUUID1 =
57 "34045B00-0000-0000-0000-000000000000"; 57 "34045B00-0000-0000-0000-000000000000";
58 const std::string BluetoothTestMac::kTestPeripheralUUID2 = 58 const std::string BluetoothTestMac::kTestPeripheralUUID2 =
59 "EC1B8F00-0000-0000-0000-000000000000"; 59 "EC1B8F00-0000-0000-0000-000000000000";
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); 206 // crypto::SHA256HashString(input_str, raw, sizeof(raw));
207 // if (base::HexEncode(raw, sizeof(raw)) == target) { 207 // if (base::HexEncode(raw, sizeof(raw)) == target) {
208 // return input_str; 208 // return input_str;
209 // } 209 // }
210 // ++input[0]; 210 // ++input[0];
211 // } 211 // }
212 // return ""; 212 // return "";
213 // } 213 // }
214 214
215 } // namespace device 215 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698