Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / device / bluetooth / test / mock_bluetooth_gatt_characteristic.h
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_CHARACTERISTIC_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_CHARACTERISTIC_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12 #include "base/callback.h"
13 #include "device/bluetooth/bluetooth_gatt_characteristic.h"
14 #include "device/bluetooth/bluetooth_uuid.h"
15 #include "testing/gmock/include/gmock/gmock.h"
16
17 namespace device {
18
19 class BluetoothGattDescriptor;
20 class BluetoothGattService;
21 class MockBluetoothGattService;
22
23 class MockBluetoothGattCharacteristic : public BluetoothGattCharacteristic {
24  public:
25   MockBluetoothGattCharacteristic(MockBluetoothGattService* service,
26                                   const std::string& identifier,
27                                   const BluetoothUUID& uuid,
28                                   bool is_local,
29                                   Properties properties,
30                                   Permissions permissions);
31   virtual ~MockBluetoothGattCharacteristic();
32
33   MOCK_CONST_METHOD0(GetIdentifier, std::string());
34   MOCK_CONST_METHOD0(GetUUID, BluetoothUUID());
35   MOCK_CONST_METHOD0(IsLocal, bool());
36   MOCK_CONST_METHOD0(GetValue, const std::vector<uint8>&());
37   MOCK_CONST_METHOD0(GetService, BluetoothGattService*());
38   MOCK_CONST_METHOD0(GetProperties, Properties());
39   MOCK_CONST_METHOD0(GetPermissions, Permissions());
40   MOCK_CONST_METHOD0(GetDescriptors, std::vector<BluetoothGattDescriptor*>());
41   MOCK_CONST_METHOD1(GetDescriptor,
42                      BluetoothGattDescriptor*(const std::string&));
43   MOCK_METHOD1(AddDescriptor, bool(BluetoothGattDescriptor*));
44   MOCK_METHOD1(UpdateValue, bool(const std::vector<uint8>&));
45   MOCK_METHOD2(ReadRemoteCharacteristic,
46                void(const ValueCallback&, const ErrorCallback&));
47   MOCK_METHOD3(WriteRemoteCharacteristic,
48                void(const std::vector<uint8>&,
49                     const base::Closure&,
50                     const ErrorCallback&));
51
52  private:
53   DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattCharacteristic);
54 };
55
56 }  // namespace device
57
58 #endif  // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_GATT_CHARACTERISTIC_H_