OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 #include <memory> |
| 6 |
5 #include "base/bind.h" | 7 #include "base/bind.h" |
6 #include "base/macros.h" | 8 #include "base/macros.h" |
7 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 11 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
11 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 12 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
12 #include "chrome/browser/ui/webui/chromeos/login/oobe_screen.h" | 13 #include "chrome/browser/ui/webui/chromeos/login/oobe_screen.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
14 #include "device/bluetooth/bluetooth_adapter_factory.h" | 15 #include "device/bluetooth/bluetooth_adapter_factory.h" |
15 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 16 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
16 #include "device/hid/fake_input_service_linux.h" | 17 #include "device/hid/fake_input_service_linux.h" |
17 #include "device/hid/input_service_linux.h" | 18 #include "device/hid/input_service_linux.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 keyboard.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT; | 88 keyboard.subsystem = InputDeviceInfo::SUBSYSTEM_INPUT; |
88 keyboard.type = InputDeviceInfo::TYPE_USB; | 89 keyboard.type = InputDeviceInfo::TYPE_USB; |
89 keyboard.is_keyboard = true; | 90 keyboard.is_keyboard = true; |
90 input_service_linux_->AddDeviceForTesting(keyboard); | 91 input_service_linux_->AddDeviceForTesting(keyboard); |
91 } | 92 } |
92 | 93 |
93 private: | 94 private: |
94 scoped_refptr< | 95 scoped_refptr< |
95 testing::NiceMock<device::MockBluetoothAdapter> > mock_adapter_; | 96 testing::NiceMock<device::MockBluetoothAdapter> > mock_adapter_; |
96 | 97 |
97 scoped_ptr<device::FakeInputServiceLinux> input_service_linux_; | 98 std::unique_ptr<device::FakeInputServiceLinux> input_service_linux_; |
98 | 99 |
99 base::WeakPtrFactory<HidDetectionTest> weak_ptr_factory_; | 100 base::WeakPtrFactory<HidDetectionTest> weak_ptr_factory_; |
100 | 101 |
101 DISALLOW_COPY_AND_ASSIGN(HidDetectionTest); | 102 DISALLOW_COPY_AND_ASSIGN(HidDetectionTest); |
102 }; | 103 }; |
103 | 104 |
104 class HidDetectionSkipTest : public HidDetectionTest { | 105 class HidDetectionSkipTest : public HidDetectionTest { |
105 public: | 106 public: |
106 HidDetectionSkipTest() { | 107 HidDetectionSkipTest() { |
107 AddUsbMouse("mouse"); | 108 AddUsbMouse("mouse"); |
108 AddUsbKeyboard("keyboard"); | 109 AddUsbKeyboard("keyboard"); |
109 } | 110 } |
110 | 111 |
111 void SetUpOnMainThread() override { | 112 void SetUpOnMainThread() override { |
112 HidDetectionTest::SetUpOnMainThread(); | 113 HidDetectionTest::SetUpOnMainThread(); |
113 } | 114 } |
114 }; | 115 }; |
115 | 116 |
116 IN_PROC_BROWSER_TEST_F(HidDetectionTest, NoDevicesConnected) { | 117 IN_PROC_BROWSER_TEST_F(HidDetectionTest, NoDevicesConnected) { |
117 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_HID_DETECTION).Wait(); | 118 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_HID_DETECTION).Wait(); |
118 } | 119 } |
119 | 120 |
120 IN_PROC_BROWSER_TEST_F(HidDetectionSkipTest, BothDevicesPreConnected) { | 121 IN_PROC_BROWSER_TEST_F(HidDetectionSkipTest, BothDevicesPreConnected) { |
121 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_NETWORK).Wait(); | 122 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_NETWORK).Wait(); |
122 } | 123 } |
123 | 124 |
124 } // namespace chromeos | 125 } // namespace chromeos |
OLD | NEW |