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 <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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 static_cast<BluetoothRemoteGattServiceMac*>(service); | 439 static_cast<BluetoothRemoteGattServiceMac*>(service); |
440 CBService* cb_service = mac_gatt_service->GetService(); | 440 CBService* cb_service = mac_gatt_service->GetService(); |
441 MockCBService* service_mock = ObjCCast<MockCBService>(cb_service); | 441 MockCBService* service_mock = ObjCCast<MockCBService>(cb_service); |
442 BluetoothRemoteGattCharacteristicMac* characteristic_mac = | 442 BluetoothRemoteGattCharacteristicMac* characteristic_mac = |
443 static_cast<BluetoothRemoteGattCharacteristicMac*>(characteristic); | 443 static_cast<BluetoothRemoteGattCharacteristicMac*>(characteristic); |
444 CBCharacteristic* cb_characteristic = | 444 CBCharacteristic* cb_characteristic = |
445 characteristic_mac->GetCBCharacteristic(); | 445 characteristic_mac->GetCBCharacteristic(); |
446 MockCBCharacteristic* characteristic_mock = | 446 MockCBCharacteristic* characteristic_mock = |
447 ObjCCast<MockCBCharacteristic>(cb_characteristic); | 447 ObjCCast<MockCBCharacteristic>(cb_characteristic); |
448 [service_mock removeCharacteristicMock:characteristic_mock]; | 448 [service_mock removeCharacteristicMock:characteristic_mock]; |
| 449 [peripheral_mock didModifyServices:@[]]; |
449 [peripheral_mock mockDidDiscoverEvents]; | 450 [peripheral_mock mockDidDiscoverEvents]; |
450 } | 451 } |
451 | 452 |
452 void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() { | 453 void BluetoothTestMac::OnFakeBluetoothDeviceConnectGattCalled() { |
453 gatt_connection_attempts_++; | 454 gatt_connection_attempts_++; |
454 } | 455 } |
455 | 456 |
456 void BluetoothTestMac::OnFakeBluetoothGattDisconnect() { | 457 void BluetoothTestMac::OnFakeBluetoothGattDisconnect() { |
457 gatt_disconnection_attempts_++; | 458 gatt_disconnection_attempts_++; |
458 } | 459 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); | 543 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); |
543 // if (base::HexEncode(raw, sizeof(raw)) == target) { | 544 // if (base::HexEncode(raw, sizeof(raw)) == target) { |
544 // return input_str; | 545 // return input_str; |
545 // } | 546 // } |
546 // ++input[0]; | 547 // ++input[0]; |
547 // } | 548 // } |
548 // return ""; | 549 // return ""; |
549 // } | 550 // } |
550 | 551 |
551 } // namespace device | 552 } // namespace device |
OLD | NEW |