Chromium Code Reviews| 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_DBUS_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_DBUS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_dbus.h" | |
| 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_device_dbus.h" | |
| 13 #include "chrome/browser/chromeos/bluetooth/bluetooth_device_interface.h" | |
| 14 #include "chromeos/dbus/bluetooth_out_of_band_client.h" | |
| 15 #include "testing/gmock/include/gmock/gmock.h" | |
| 16 | |
| 17 namespace chromeos { | |
| 18 | |
| 19 class MockBluetoothAdapterDBus : public BluetoothAdapterDBus { | |
|
bryeung
2012/09/07 18:35:57
The mocks should be shared for all platforms.
youngki
2012/09/13 18:05:02
Done.
| |
| 20 public: | |
| 21 class Observer : public BluetoothAdapterDBus::Observer { | |
| 22 public: | |
| 23 Observer(); | |
| 24 virtual ~Observer(); | |
| 25 | |
| 26 MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapterDBus*, bool)); | |
| 27 MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapterDBus*, bool)); | |
| 28 MOCK_METHOD2(AdapterDiscoveringChanged, | |
| 29 void(BluetoothAdapterDBus *, bool)); | |
| 30 MOCK_METHOD2(DeviceAdded, | |
| 31 void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); | |
| 32 MOCK_METHOD2(DeviceChanged, | |
| 33 void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); | |
| 34 MOCK_METHOD2(DeviceRemoved, | |
| 35 void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); | |
| 36 }; | |
| 37 | |
| 38 MockBluetoothAdapterDBus(const std::string& address, | |
| 39 const std::string& name); | |
| 40 | |
| 41 MOCK_CONST_METHOD0(IsPresent, bool()); | |
| 42 MOCK_CONST_METHOD0(IsPowered, bool()); | |
| 43 MOCK_CONST_METHOD0(IsDiscovering, bool()); | |
| 44 MOCK_METHOD3( | |
| 45 SetDiscovering, | |
| 46 void(bool discovering, | |
| 47 const base::Closure& callback, | |
| 48 const ErrorCallback& error_callback)); | |
| 49 MOCK_CONST_METHOD0(GetDevices, ConstDeviceList()); | |
| 50 MOCK_METHOD1(GetDevice, | |
| 51 BluetoothDeviceInterface*(const std::string& address)); | |
| 52 MOCK_CONST_METHOD1( | |
| 53 GetDevice, | |
| 54 const BluetoothDeviceInterface*(const std::string& address)); | |
| 55 MOCK_METHOD2( | |
| 56 ReadLocalOutOfBandPairingData, | |
| 57 void(const BluetoothOutOfBandPairingDataCallback& callback, | |
| 58 const ErrorCallback& error_callback)); | |
| 59 protected: | |
| 60 virtual ~MockBluetoothAdapterDBus(); | |
| 61 }; | |
| 62 | |
| 63 } // namespace chromeos | |
| 64 | |
| 65 #endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_DBUS_H_ | |
| OLD | NEW |