| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |