| OLD | NEW |
| (Empty) |
| 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 CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" | |
| 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" | |
| 13 #include "chromeos/dbus/bluetooth_out_of_band_client.h" | |
| 14 #include "testing/gmock/include/gmock/gmock.h" | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 class MockBluetoothAdapter : public BluetoothAdapter { | |
| 19 public: | |
| 20 class Observer : public BluetoothAdapter::Observer { | |
| 21 public: | |
| 22 Observer(); | |
| 23 virtual ~Observer(); | |
| 24 | |
| 25 MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapter*, bool)); | |
| 26 MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapter*, bool)); | |
| 27 MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter*, bool)); | |
| 28 MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter*, BluetoothDevice*)); | |
| 29 MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter*, BluetoothDevice*)); | |
| 30 MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter*, BluetoothDevice*)); | |
| 31 }; | |
| 32 | |
| 33 MockBluetoothAdapter(const std::string& address, const std::string& name); | |
| 34 | |
| 35 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*)); | |
| 36 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*)); | |
| 37 MOCK_CONST_METHOD0(IsPresent, bool()); | |
| 38 MOCK_CONST_METHOD0(IsPowered, bool()); | |
| 39 MOCK_METHOD3(SetPowered, | |
| 40 void(bool discovering, | |
| 41 const base::Closure& callback, | |
| 42 const ErrorCallback& error_callback)); | |
| 43 MOCK_CONST_METHOD0(IsDiscovering, bool()); | |
| 44 MOCK_METHOD3(SetDiscovering, | |
| 45 void(bool discovering, | |
| 46 const base::Closure& callback, | |
| 47 const ErrorCallback& error_callback)); | |
| 48 MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList()); | |
| 49 MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address)); | |
| 50 MOCK_CONST_METHOD1(GetDevice, | |
| 51 const BluetoothDevice*(const std::string& address)); | |
| 52 MOCK_METHOD2( | |
| 53 ReadLocalOutOfBandPairingData, | |
| 54 void(const BluetoothOutOfBandPairingDataCallback& callback, | |
| 55 const ErrorCallback& error_callback)); | |
| 56 protected: | |
| 57 virtual ~MockBluetoothAdapter(); | |
| 58 }; | |
| 59 | |
| 60 } // namespace chromeos | |
| 61 | |
| 62 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_ | |
| OLD | NEW |