Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / device / bluetooth / test / mock_bluetooth_adapter.h
1 // Copyright (c) 2012 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_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "device/bluetooth/bluetooth_adapter.h"
12 #include "device/bluetooth/bluetooth_device.h"
13 #include "testing/gmock/include/gmock/gmock.h"
14
15 namespace device {
16
17 class MockBluetoothAdapter : public BluetoothAdapter {
18  public:
19   class Observer : public BluetoothAdapter::Observer {
20    public:
21     Observer();
22     virtual ~Observer();
23
24     MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapter*, bool));
25     MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapter*, bool));
26     MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter*, bool));
27     MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter*, BluetoothDevice*));
28     MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter*, BluetoothDevice*));
29     MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter*, BluetoothDevice*));
30   };
31
32   MockBluetoothAdapter();
33
34   MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*));
35   MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*));
36   MOCK_CONST_METHOD0(GetAddress, std::string());
37   MOCK_CONST_METHOD0(GetName, std::string());
38   MOCK_METHOD3(SetName,
39                void(const std::string& name,
40                     const base::Closure& callback,
41                     const ErrorCallback& error_callback));
42   MOCK_CONST_METHOD0(IsInitialized, bool());
43   MOCK_CONST_METHOD0(IsPresent, bool());
44   MOCK_CONST_METHOD0(IsPowered, bool());
45   MOCK_METHOD3(SetPowered,
46                void(bool powered,
47                     const base::Closure& callback,
48                     const ErrorCallback& error_callback));
49   MOCK_CONST_METHOD0(IsDiscoverable, bool());
50   MOCK_METHOD3(SetDiscoverable,
51                void(bool discoverable,
52                     const base::Closure& callback,
53                     const ErrorCallback& error_callback));
54   MOCK_CONST_METHOD0(IsDiscovering, bool());
55   MOCK_METHOD2(StartDiscovering,
56                void(const base::Closure& callback,
57                     const ErrorCallback& error_callback));
58   MOCK_METHOD2(StopDiscovering,
59                void(const base::Closure& callback,
60                     const ErrorCallback& error_callback));
61   MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList());
62   MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address));
63   MOCK_CONST_METHOD1(GetDevice,
64                      const BluetoothDevice*(const std::string& address));
65   MOCK_METHOD2(
66       ReadLocalOutOfBandPairingData,
67       void(const BluetoothOutOfBandPairingDataCallback& callback,
68            const ErrorCallback& error_callback));
69  protected:
70   virtual ~MockBluetoothAdapter();
71 };
72
73 }  // namespace device
74
75 #endif  // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_