diff options
author | jpawlowski <jpawlowski@chromium.org> | 2015-04-22 16:56:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-22 23:56:44 +0000 |
commit | 80991971596010e876396e9778101343b90c528c (patch) | |
tree | 9c774f9fdfa207c338c0fcd5cf96948749709b0c /device | |
parent | 735aa03be45990a5e2feb3c38087e6f76eb920ac (diff) | |
download | chromium_src-80991971596010e876396e9778101343b90c528c.zip chromium_src-80991971596010e876396e9778101343b90c528c.tar.gz chromium_src-80991971596010e876396e9778101343b90c528c.tar.bz2 |
Wire SetDiscoveryFilter from BluetoothPrivate To BluetoothEventRouter
Currrently bluetoothPrivate.SetDiscoveryFilter does nothing.
This patch wires the call properly to make it actually set filter.
"platform" field is removed in extensions/common/api/bluetooth_private.json to enable platform independent testing.
BUG=407773
R=armansito@chromium.org
Review URL: https://codereview.chromium.org/1094903004
Cr-Commit-Position: refs/heads/master@{#326405}
Diffstat (limited to 'device')
4 files changed, 21 insertions, 0 deletions
diff --git a/device/bluetooth/test/mock_bluetooth_adapter.cc b/device/bluetooth/test/mock_bluetooth_adapter.cc index a021bfd..9a3e953 100644 --- a/device/bluetooth/test/mock_bluetooth_adapter.cc +++ b/device/bluetooth/test/mock_bluetooth_adapter.cc @@ -39,6 +39,7 @@ void MockBluetoothAdapter::SetDiscoveryFilter( scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, const base::Closure& callback, const ErrorCallback& error_callback) { + SetDiscoveryFilterRaw(discovery_filter.get(), callback, error_callback); } void MockBluetoothAdapter::StartDiscoverySessionWithFilter( diff --git a/device/bluetooth/test/mock_bluetooth_adapter.h b/device/bluetooth/test/mock_bluetooth_adapter.h index 3abe858..38c2f5a 100644 --- a/device/bluetooth/test/mock_bluetooth_adapter.h +++ b/device/bluetooth/test/mock_bluetooth_adapter.h @@ -65,6 +65,10 @@ class MockBluetoothAdapter : public BluetoothAdapter { void(const BluetoothDiscoveryFilter*, const DiscoverySessionCallback& callback, const ErrorCallback& error_callback)); + MOCK_METHOD3(SetDiscoveryFilterRaw, + void(const BluetoothDiscoveryFilter*, + const base::Closure& callback, + const ErrorCallback& error_callback)); MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList()); MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address)); MOCK_CONST_METHOD1(GetDevice, diff --git a/device/bluetooth/test/mock_bluetooth_discovery_session.cc b/device/bluetooth/test/mock_bluetooth_discovery_session.cc index 1aea85a..08f3dae 100644 --- a/device/bluetooth/test/mock_bluetooth_discovery_session.cc +++ b/device/bluetooth/test/mock_bluetooth_discovery_session.cc @@ -21,4 +21,11 @@ MockBluetoothDiscoverySession::MockBluetoothDiscoverySession() } MockBluetoothDiscoverySession::~MockBluetoothDiscoverySession() {} +void MockBluetoothDiscoverySession::SetDiscoveryFilter( + scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, + const base::Closure& callback, + const ErrorCallback& error_callback) { + SetDiscoveryFilterRaw(discovery_filter.get(), callback, error_callback); +} + } // namespace device diff --git a/device/bluetooth/test/mock_bluetooth_discovery_session.h b/device/bluetooth/test/mock_bluetooth_discovery_session.h index bd724a7..e9009a8 100644 --- a/device/bluetooth/test/mock_bluetooth_discovery_session.h +++ b/device/bluetooth/test/mock_bluetooth_discovery_session.h @@ -20,6 +20,15 @@ class MockBluetoothDiscoverySession : public BluetoothDiscoverySession { MOCK_METHOD2(Stop, void(const base::Closure& callback, const ErrorCallback& error_callback)); + MOCK_METHOD3(SetDiscoveryFilterRaw, + void(BluetoothDiscoveryFilter* discovery_filter, + const base::Closure& callback, + const ErrorCallback& error_callback)); + + protected: + void SetDiscoveryFilter(scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, + const base::Closure& callback, + const ErrorCallback& error_callback) override; private: DISALLOW_COPY_AND_ASSIGN(MockBluetoothDiscoverySession); |