Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / device / bluetooth / test / mock_bluetooth_discovery_session.cc
blob08f3daeda9effc990716a2be8adc3bf87fe678cc
1 // Copyright 2014 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.
5 #include "device/bluetooth/test/mock_bluetooth_discovery_session.h"
7 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
9 namespace device {
11 // Note: Because |this| class mocks out all the interesting method calls, the
12 // mock BluetoothAdapter will not be used, except for a trivial call from the
13 // destructor. It's passed in simply because the base class expects one, and
14 // it's nice not to need to complicate production code for the sake of simpler
15 // test code.
16 MockBluetoothDiscoverySession::MockBluetoothDiscoverySession()
17 : BluetoothDiscoverySession(
18 scoped_refptr<BluetoothAdapter>(
19 new testing::NiceMock<MockBluetoothAdapter>()),
20 nullptr) {
22 MockBluetoothDiscoverySession::~MockBluetoothDiscoverySession() {}
24 void MockBluetoothDiscoverySession::SetDiscoveryFilter(
25 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter,
26 const base::Closure& callback,
27 const ErrorCallback& error_callback) {
28 SetDiscoveryFilterRaw(discovery_filter.get(), callback, error_callback);
31 } // namespace device