Index: chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter_dbus.h |
diff --git a/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter_dbus.h b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter_dbus.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e53de549a399b7c861983fe762d31ce7d65ef44d |
--- /dev/null |
+++ b/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter_dbus.h |
@@ -0,0 +1,65 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_DBUS_H_ |
+#define CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_DBUS_H_ |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_dbus.h" |
+#include "chrome/browser/chromeos/bluetooth/bluetooth_device_dbus.h" |
+#include "chrome/browser/chromeos/bluetooth/bluetooth_device_interface.h" |
+#include "chromeos/dbus/bluetooth_out_of_band_client.h" |
+#include "testing/gmock/include/gmock/gmock.h" |
+ |
+namespace chromeos { |
+ |
+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.
|
+ public: |
+ class Observer : public BluetoothAdapterDBus::Observer { |
+ public: |
+ Observer(); |
+ virtual ~Observer(); |
+ |
+ MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapterDBus*, bool)); |
+ MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapterDBus*, bool)); |
+ MOCK_METHOD2(AdapterDiscoveringChanged, |
+ void(BluetoothAdapterDBus *, bool)); |
+ MOCK_METHOD2(DeviceAdded, |
+ void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); |
+ MOCK_METHOD2(DeviceChanged, |
+ void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); |
+ MOCK_METHOD2(DeviceRemoved, |
+ void(BluetoothAdapterDBus *, BluetoothDeviceDBus *)); |
+ }; |
+ |
+ MockBluetoothAdapterDBus(const std::string& address, |
+ const std::string& name); |
+ |
+ MOCK_CONST_METHOD0(IsPresent, bool()); |
+ MOCK_CONST_METHOD0(IsPowered, bool()); |
+ MOCK_CONST_METHOD0(IsDiscovering, bool()); |
+ MOCK_METHOD3( |
+ SetDiscovering, |
+ void(bool discovering, |
+ const base::Closure& callback, |
+ const ErrorCallback& error_callback)); |
+ MOCK_CONST_METHOD0(GetDevices, ConstDeviceList()); |
+ MOCK_METHOD1(GetDevice, |
+ BluetoothDeviceInterface*(const std::string& address)); |
+ MOCK_CONST_METHOD1( |
+ GetDevice, |
+ const BluetoothDeviceInterface*(const std::string& address)); |
+ MOCK_METHOD2( |
+ ReadLocalOutOfBandPairingData, |
+ void(const BluetoothOutOfBandPairingDataCallback& callback, |
+ const ErrorCallback& error_callback)); |
+ protected: |
+ virtual ~MockBluetoothAdapterDBus(); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_DBUS_H_ |