summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/test/mock_bluetooth_discovery_session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'device/bluetooth/test/mock_bluetooth_discovery_session.cc')
-rw-r--r--device/bluetooth/test/mock_bluetooth_discovery_session.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/device/bluetooth/test/mock_bluetooth_discovery_session.cc b/device/bluetooth/test/mock_bluetooth_discovery_session.cc
index 72449ee..295f954 100644
--- a/device/bluetooth/test/mock_bluetooth_discovery_session.cc
+++ b/device/bluetooth/test/mock_bluetooth_discovery_session.cc
@@ -4,11 +4,19 @@
#include "device/bluetooth/test/mock_bluetooth_discovery_session.h"
-#include "device/bluetooth/bluetooth_adapter.h"
+#include "device/bluetooth/test/mock_bluetooth_adapter.h"
namespace device {
-MockBluetoothDiscoverySession::MockBluetoothDiscoverySession() {}
+// Note: Because |this| class mocks out all the interesting method calls, the
+// mock BluetoothAdapter will not be used, except for a trivial call from the
+// destructor. It's passed in simply because the base class expects one, and
+// it's nice not to need to complicate production code for the sake of simpler
+// test code.
+MockBluetoothDiscoverySession::MockBluetoothDiscoverySession()
+ : BluetoothDiscoverySession(
+ scoped_refptr<BluetoothAdapter>(
+ new testing::NiceMock<MockBluetoothAdapter>())) {}
MockBluetoothDiscoverySession::~MockBluetoothDiscoverySession() {}
} // namespace device