| Index: chrome/browser/chromeos/login/hid_detection_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/login/hid_detection_browsertest.cc b/chrome/browser/chromeos/login/hid_detection_browsertest.cc
|
| index 44392fe2ce66cf2dd04f88233934ebf9ca471adc..ff50f9a4e997ffbab0f104328fe3efaa51773687 100644
|
| --- a/chrome/browser/chromeos/login/hid_detection_browsertest.cc
|
| +++ b/chrome/browser/chromeos/login/hid_detection_browsertest.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/macros.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
|
| @@ -57,8 +58,8 @@ class HidDetectionTest : public OobeBaseTest {
|
| ~HidDetectionTest() override {}
|
|
|
| void InitInputService() {
|
| - input_service_linux_.reset(new device::FakeInputServiceLinux);
|
| - InputServiceLinux::SetForTesting(input_service_linux_.get());
|
| + InputServiceLinux::SetForTesting(
|
| + base::MakeUnique<device::FakeInputServiceLinux>());
|
| }
|
|
|
| void SetUpOnMainThread() override {
|
| @@ -78,8 +79,7 @@ class HidDetectionTest : public OobeBaseTest {
|
| mouse.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT;
|
| mouse.type = InputDeviceInfo::TYPE_USB;
|
| mouse.is_mouse = true;
|
| - LOG(ERROR) << input_service_linux_.get();
|
| - input_service_linux_->AddDeviceForTesting(mouse);
|
| + AddDeviceForTesting(mouse);
|
| }
|
|
|
| void AddUsbKeyboard(const std::string& keyboard_id) {
|
| @@ -88,15 +88,19 @@ class HidDetectionTest : public OobeBaseTest {
|
| keyboard.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT;
|
| keyboard.type = InputDeviceInfo::TYPE_USB;
|
| keyboard.is_keyboard = true;
|
| - input_service_linux_->AddDeviceForTesting(keyboard);
|
| + AddDeviceForTesting(keyboard);
|
| }
|
|
|
| private:
|
| + void AddDeviceForTesting(const InputDeviceInfo& info) {
|
| + static_cast<device::FakeInputServiceLinux*>(
|
| + device::InputServiceLinux::GetInstance())
|
| + ->AddDeviceForTesting(info);
|
| + }
|
| +
|
| scoped_refptr<
|
| testing::NiceMock<device::MockBluetoothAdapter> > mock_adapter_;
|
|
|
| - std::unique_ptr<device::FakeInputServiceLinux> input_service_linux_;
|
| -
|
| base::WeakPtrFactory<HidDetectionTest> weak_ptr_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(HidDetectionTest);
|
|
|