GoogleURLTrackerInfoBarDelegate: Initialize uninitialized member in constructor.
[chromium-blink-merge.git] / device / bluetooth / test / mock_bluetooth_adapter.h
blob03261922cd9e26e1eacec5a77a21a5c96eda68c5
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.
5 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
8 #include <string>
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"
15 namespace device {
17 class MockBluetoothAdapter : public BluetoothAdapter {
18 public:
19 class Observer : public BluetoothAdapter::Observer {
20 public:
21 Observer();
22 virtual ~Observer();
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*));
32 MockBluetoothAdapter();
34 virtual bool IsInitialized() const { return true; }
36 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*));
37 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*));
38 MOCK_CONST_METHOD0(GetAddress, std::string());
39 MOCK_CONST_METHOD0(GetName, std::string());
40 MOCK_METHOD3(SetName,
41 void(const std::string& name,
42 const base::Closure& callback,
43 const ErrorCallback& error_callback));
44 MOCK_CONST_METHOD0(IsPresent, bool());
45 MOCK_CONST_METHOD0(IsPowered, bool());
46 MOCK_METHOD3(SetPowered,
47 void(bool powered,
48 const base::Closure& callback,
49 const ErrorCallback& error_callback));
50 MOCK_CONST_METHOD0(IsDiscoverable, bool());
51 MOCK_METHOD3(SetDiscoverable,
52 void(bool discoverable,
53 const base::Closure& callback,
54 const ErrorCallback& error_callback));
55 MOCK_CONST_METHOD0(IsDiscovering, bool());
56 MOCK_METHOD2(StartDiscoverySession,
57 void(const DiscoverySessionCallback& callback,
58 const ErrorCallback& error_callback));
59 MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList());
60 MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address));
61 MOCK_CONST_METHOD1(GetDevice,
62 const BluetoothDevice*(const std::string& address));
63 MOCK_METHOD2(AddPairingDelegate,
64 void(BluetoothDevice::PairingDelegate* pairing_delegate,
65 enum PairingDelegatePriority priority));
66 MOCK_METHOD1(RemovePairingDelegate,
67 void(BluetoothDevice::PairingDelegate* pairing_delegate));
68 MOCK_METHOD0(DefaultPairingDelegate, BluetoothDevice::PairingDelegate*());
69 MOCK_METHOD5(CreateRfcommService,
70 void(const BluetoothUUID& uuid,
71 int channel,
72 bool insecure,
73 const CreateServiceCallback& callback,
74 const CreateServiceErrorCallback& error_callback));
75 MOCK_METHOD4(CreateL2capService,
76 void(const BluetoothUUID& uuid,
77 int psm,
78 const CreateServiceCallback& callback,
79 const CreateServiceErrorCallback& error_callback));
81 protected:
82 virtual void AddDiscoverySession(const base::Closure& callback,
83 const ErrorCallback& error_callback);
84 virtual void RemoveDiscoverySession(const base::Closure& callback,
85 const ErrorCallback& error_callback);
86 virtual ~MockBluetoothAdapter();
88 MOCK_METHOD1(RemovePairingDelegateInternal,
89 void(BluetoothDevice::PairingDelegate* pairing_delegate));
92 } // namespace device
94 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_