Chromium Code Reviews| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" | 9 #include "chrome/browser/chromeos/login/test/oobe_base_test.h" |
| 10 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 10 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 EXPECT_CALL(*mock_adapter, IsPowered()) | 36 EXPECT_CALL(*mock_adapter, IsPowered()) |
| 37 .WillRepeatedly(testing::Return(true)); | 37 .WillRepeatedly(testing::Return(true)); |
| 38 EXPECT_CALL(*mock_adapter, GetDevices()).WillRepeatedly( | 38 EXPECT_CALL(*mock_adapter, GetDevices()).WillRepeatedly( |
| 39 testing::Return(device::BluetoothAdapter::ConstDeviceList())); | 39 testing::Return(device::BluetoothAdapter::ConstDeviceList())); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 namespace chromeos { | 44 namespace chromeos { |
| 45 | 45 |
| 46 class HidDetectionTest : public OobeBaseTest { | 46 class HidDetectionTest : public OobeBaseTest, |
| 47 public testing::WithParamInterface<bool> { | |
| 47 public: | 48 public: |
| 48 typedef device::InputServiceLinux::InputDeviceInfo InputDeviceInfo; | 49 typedef device::InputServiceLinux::InputDeviceInfo InputDeviceInfo; |
| 49 | 50 |
| 50 HidDetectionTest() : weak_ptr_factory_(this) { | 51 HidDetectionTest() : weak_ptr_factory_(this) { |
| 52 use_webview_ = GetParam(); | |
|
dzhioev (left Google)
2015/04/15 17:36:25
Create setter.
Nikita (slow)
2015/04/15 18:35:42
Done.
| |
| 51 InputServiceProxy::SetThreadIdForTesting(content::BrowserThread::UI); | 53 InputServiceProxy::SetThreadIdForTesting(content::BrowserThread::UI); |
| 52 HidDetectionTest::InitInputService(); | 54 HidDetectionTest::InitInputService(); |
| 53 } | 55 } |
| 54 | 56 |
| 55 ~HidDetectionTest() override {} | 57 ~HidDetectionTest() override {} |
| 56 | 58 |
| 57 void InitInputService() { | 59 void InitInputService() { |
| 58 input_service_linux_.reset(new device::FakeInputServiceLinux); | 60 input_service_linux_.reset(new device::FakeInputServiceLinux); |
| 59 InputServiceLinux::SetForTesting(input_service_linux_.get()); | 61 InputServiceLinux::SetForTesting(input_service_linux_.get()); |
| 60 } | 62 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 HidDetectionSkipTest() { | 107 HidDetectionSkipTest() { |
| 106 AddUsbMouse("mouse"); | 108 AddUsbMouse("mouse"); |
| 107 AddUsbKeyboard("keyboard"); | 109 AddUsbKeyboard("keyboard"); |
| 108 } | 110 } |
| 109 | 111 |
| 110 void SetUpOnMainThread() override { | 112 void SetUpOnMainThread() override { |
| 111 HidDetectionTest::SetUpOnMainThread(); | 113 HidDetectionTest::SetUpOnMainThread(); |
| 112 } | 114 } |
| 113 }; | 115 }; |
| 114 | 116 |
| 115 IN_PROC_BROWSER_TEST_F(HidDetectionTest, NoDevicesConnected) { | 117 IN_PROC_BROWSER_TEST_P(HidDetectionTest, NoDevicesConnected) { |
| 116 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_HID_DETECTION).Wait(); | 118 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_HID_DETECTION).Wait(); |
| 117 } | 119 } |
| 118 | 120 |
| 119 IN_PROC_BROWSER_TEST_F(HidDetectionSkipTest, BothDevicesPreConnected) { | 121 IN_PROC_BROWSER_TEST_P(HidDetectionSkipTest, BothDevicesPreConnected) { |
| 120 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_NETWORK).Wait(); | 122 OobeScreenWaiter(OobeDisplay::SCREEN_OOBE_NETWORK).Wait(); |
| 121 | |
| 122 } | 123 } |
| 123 | 124 |
| 125 INSTANTIATE_TEST_CASE_P(HidDetectionSuite, HidDetectionTest, testing::Bool()); | |
| 126 INSTANTIATE_TEST_CASE_P(HidDetectionSkipSuite, | |
| 127 HidDetectionSkipTest, | |
| 128 testing::Bool()); | |
| 129 | |
| 124 } // namespace chromeos | 130 } // namespace chromeos |
| OLD | NEW |