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

Side by Side Diff: device/bluetooth/test/mock_bluetooth_gatt_descriptor.h

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ 6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "device/bluetooth/bluetooth_gatt_characteristic.h" 15 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
16 #include "device/bluetooth/bluetooth_gatt_descriptor.h" 16 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h"
17 #include "device/bluetooth/bluetooth_uuid.h" 17 #include "device/bluetooth/bluetooth_uuid.h"
18 #include "testing/gmock/include/gmock/gmock.h" 18 #include "testing/gmock/include/gmock/gmock.h"
19 19
20 namespace device { 20 namespace device {
21 21
22 class MockBluetoothGattCharacteristic; 22 class MockBluetoothGattCharacteristic;
23 23
24 class MockBluetoothGattDescriptor : public BluetoothGattDescriptor { 24 class MockBluetoothGattDescriptor : public BluetoothRemoteGattDescriptor {
scheib 2016/04/20 01:23:30 Intentionally not using MockBluetoothRemoteGattDes
rkc 2016/04/20 16:31:54 This class isn't getting used anywhere. I've put a
25 public: 25 public:
26 MockBluetoothGattDescriptor( 26 MockBluetoothGattDescriptor(
27 MockBluetoothGattCharacteristic* characteristic, 27 MockBluetoothGattCharacteristic* characteristic,
28 const std::string& identifier, 28 const std::string& identifier,
29 const BluetoothUUID& uuid, 29 const BluetoothUUID& uuid,
30 bool is_local, 30 bool is_local,
31 BluetoothGattCharacteristic::Permissions permissions); 31 BluetoothRemoteGattCharacteristic::Permissions permissions);
32 virtual ~MockBluetoothGattDescriptor(); 32 virtual ~MockBluetoothGattDescriptor();
33 33
34 MOCK_CONST_METHOD0(GetIdentifier, std::string()); 34 MOCK_CONST_METHOD0(GetIdentifier, std::string());
35 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID()); 35 MOCK_CONST_METHOD0(GetUUID, BluetoothUUID());
36 MOCK_CONST_METHOD0(IsLocal, bool()); 36 MOCK_CONST_METHOD0(IsLocal, bool());
37 MOCK_CONST_METHOD0(GetValue, const std::vector<uint8_t>&()); 37 MOCK_CONST_METHOD0(GetValue, const std::vector<uint8_t>&());
38 MOCK_CONST_METHOD0(GetCharacteristic, BluetoothGattCharacteristic*()); 38 MOCK_CONST_METHOD0(GetCharacteristic, BluetoothRemoteGattCharacteristic*());
39 MOCK_CONST_METHOD0(GetPermissions, 39 MOCK_CONST_METHOD0(GetPermissions,
40 BluetoothGattCharacteristic::Permissions()); 40 BluetoothRemoteGattCharacteristic::Permissions());
41 MOCK_METHOD2(ReadRemoteDescriptor, 41 MOCK_METHOD2(ReadRemoteDescriptor,
42 void(const ValueCallback&, const ErrorCallback&)); 42 void(const ValueCallback&, const ErrorCallback&));
43 MOCK_METHOD3(WriteRemoteDescriptor, 43 MOCK_METHOD3(WriteRemoteDescriptor,
44 void(const std::vector<uint8_t>&, 44 void(const std::vector<uint8_t>&,
45 const base::Closure&, 45 const base::Closure&,
46 const ErrorCallback&)); 46 const ErrorCallback&));
47 47
48 private: 48 private:
49 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattDescriptor); 49 DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattDescriptor);
50 }; 50 };
51 51
52 } // namespace device 52 } // namespace device
53 53
54 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_ 54 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_DESCRIPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698