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

Side by Side Diff: device/bluetooth/test/bluetooth_test_mac.mm

Issue 2783733002: Bluetooth: Add service data unit tests for chromeos (Closed)
Patch Set: comments and rebase Created 3 years, 8 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/test/bluetooth_test_bluez.cc ('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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 case 2: 169 case 2:
170 identifier = kTestPeripheralUUID1.c_str(); 170 identifier = kTestPeripheralUUID1.c_str();
171 name = @(kTestDeviceName.c_str()); 171 name = @(kTestDeviceName.c_str());
172 rssi = @(static_cast<int8_t>(TestRSSI::LOWER)); 172 rssi = @(static_cast<int8_t>(TestRSSI::LOWER));
173 uuids = @[ 173 uuids = @[
174 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())], 174 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())],
175 [CBUUID UUIDWithString:@(kTestUUIDLinkLoss.c_str())] 175 [CBUUID UUIDWithString:@(kTestUUIDLinkLoss.c_str())]
176 ]; 176 ];
177 service_data = @{ 177 service_data = @{
178 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] : 178 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] :
179 [NSData dataWithBytes:(unsigned char[]){2} length:1], 179 [NSData dataWithBytes:(unsigned char[]){} length:0],
ortuno 2017/04/03 23:55:51 Ah seems like we need to fix the test data for the
180 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())] : 180 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())] :
181 [NSData dataWithBytes:(unsigned char[]){0} length:1] 181 [NSData dataWithBytes:(unsigned char[]){0, 2} length:2]
182 }; 182 };
183 tx_power = @(static_cast<int8_t>(TestTxPower::LOWER)); 183 tx_power = @(static_cast<int8_t>(TestTxPower::LOWER));
184 break; 184 break;
185 case 3: 185 case 3:
186 identifier = kTestPeripheralUUID1.c_str(); 186 identifier = kTestPeripheralUUID1.c_str();
187 name = @(kTestDeviceNameEmpty.c_str()); 187 name = @(kTestDeviceNameEmpty.c_str());
188 rssi = @(static_cast<int8_t>(TestRSSI::LOW)); 188 rssi = @(static_cast<int8_t>(TestRSSI::LOW));
189 uuids = nil; 189 uuids = nil;
190 service_data = nil; 190 service_data = nil;
191 tx_power = nil; 191 tx_power = nil;
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); 589 // crypto::SHA256HashString(input_str, raw, sizeof(raw));
590 // if (base::HexEncode(raw, sizeof(raw)) == target) { 590 // if (base::HexEncode(raw, sizeof(raw)) == target) {
591 // return input_str; 591 // return input_str;
592 // } 592 // }
593 // ++input[0]; 593 // ++input[0];
594 // } 594 // }
595 // return ""; 595 // return "";
596 // } 596 // }
597 597
598 } // namespace device 598 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_bluez.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698