Chromium Code Reviews| Index: chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc |
| diff --git a/chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc b/chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc |
| index 256e372c7044dc53998851b2e32cf4d7ec9e9f25..e130dc77f71be2cbe0db752cf6ec152e2c4c3a2c 100644 |
| --- a/chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc |
| +++ b/chrome/browser/chromeos/login/bluetooth_host_pairing_browsertest.cc |
| @@ -2,6 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/memory/ptr_util.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/run_loop.h" |
| #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| @@ -54,8 +55,8 @@ class BluetoothHostPairingNoInputTest : public OobeBaseTest { |
| BluetoothHostPairingNoInputTest() { |
| InputServiceProxy::SetThreadIdForTesting(content::BrowserThread::UI); |
| - input_service_linux_.reset(new device::FakeInputServiceLinux); |
| - device::InputServiceLinux::SetForTesting(input_service_linux_.get()); |
| + device::InputServiceLinux::SetForTesting( |
| + base::MakeUnique<device::FakeInputServiceLinux>()); |
| } |
| ~BluetoothHostPairingNoInputTest() override {} |
| @@ -88,7 +89,9 @@ class BluetoothHostPairingNoInputTest : public OobeBaseTest { |
| mouse.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT; |
| mouse.type = InputDeviceInfo::TYPE_USB; |
| mouse.is_mouse = true; |
| - input_service_linux_->AddDeviceForTesting(mouse); |
| + static_cast<device::FakeInputServiceLinux*>( |
|
achuithb
2016/11/10 23:24:00
Could you pull this out into a helper like
void Ad
fdoray
2016/11/11 14:21:45
Done.
|
| + device::InputServiceLinux::GetInstance()) |
| + ->AddDeviceForTesting(mouse); |
| } |
| void AddUsbKeyboard() { |
| @@ -97,7 +100,9 @@ class BluetoothHostPairingNoInputTest : public OobeBaseTest { |
| keyboard.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT; |
| keyboard.type = InputDeviceInfo::TYPE_USB; |
| keyboard.is_keyboard = true; |
| - input_service_linux_->AddDeviceForTesting(keyboard); |
| + static_cast<device::FakeInputServiceLinux*>( |
| + device::InputServiceLinux::GetInstance()) |
| + ->AddDeviceForTesting(keyboard); |
| } |
| void AddBluetoothMouse() { |
| @@ -106,11 +111,12 @@ class BluetoothHostPairingNoInputTest : public OobeBaseTest { |
| mouse.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT; |
| mouse.type = InputDeviceInfo::TYPE_BLUETOOTH; |
| mouse.is_mouse = true; |
| - input_service_linux_->AddDeviceForTesting(mouse); |
| + static_cast<device::FakeInputServiceLinux*>( |
| + device::InputServiceLinux::GetInstance()) |
| + ->AddDeviceForTesting(mouse); |
| } |
| private: |
| - std::unique_ptr<device::FakeInputServiceLinux> input_service_linux_; |
| scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; |
| std::unique_ptr<TestDelegate> delegate_; |