Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2595)

Unified Diff: device/bluetooth/test/mock_bluetooth_adapter.h

Issue 1132943002: bluetooth: Move mock creation out of BluetoothDispatcherHost to LayoutTestBluetoothAdapterProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-testing-layout-tests
Patch Set: Update documentation. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/mock_bluetooth_adapter.h
diff --git a/device/bluetooth/test/mock_bluetooth_adapter.h b/device/bluetooth/test/mock_bluetooth_adapter.h
index e1523f9a6eb5793153290d1814994da3e30ef026..dfa647337b7a41dc5126bfac05f007daadc6c8c3 100644
--- a/device/bluetooth/test/mock_bluetooth_adapter.h
+++ b/device/bluetooth/test/mock_bluetooth_adapter.h
@@ -8,10 +8,12 @@
#include <string>
#include "base/callback.h"
+#include "base/memory/scoped_vector.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_audio_sink.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_discovery_session.h"
+#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace device {
@@ -99,6 +101,11 @@ class MockBluetoothAdapter : public BluetoothAdapter {
const DiscoverySessionCallback& callback,
const ErrorCallback& error_callback);
+ // BluetoothAdapter is supposed to manage the lifetime of BluetoothDevices.
+ // This methods takes ownership of the BluetoothDevices.
+ void AddMockDevice(scoped_ptr<MockBluetoothDevice> mock_device);
+ BluetoothAdapter::ConstDeviceList GetMockDevices();
+
protected:
void AddDiscoverySession(BluetoothDiscoveryFilter* discovery_filter,
const base::Closure& callback,
@@ -117,6 +124,8 @@ class MockBluetoothAdapter : public BluetoothAdapter {
MOCK_METHOD1(RemovePairingDelegateInternal,
void(BluetoothDevice::PairingDelegate* pairing_delegate));
+
+ ScopedVector<MockBluetoothDevice> mock_devices_;
};
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698