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 "ash/virtual_keyboard_controller.h" | 5 #include "ash/virtual_keyboard_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h" | 8 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 ASSERT_TRUE(IsVirtualKeyboardSuppressed()); | 178 ASSERT_TRUE(IsVirtualKeyboardSuppressed()); |
179 // Remove external keyboard. Should be notified that the keyboard is not | 179 // Remove external keyboard. Should be notified that the keyboard is not |
180 // suppressed. | 180 // suppressed. |
181 ResetObserver(); | 181 ResetObserver(); |
182 UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>()); | 182 UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>()); |
183 ASSERT_TRUE(keyboard::IsKeyboardEnabled()); | 183 ASSERT_TRUE(keyboard::IsKeyboardEnabled()); |
184 ASSERT_TRUE(notified()); | 184 ASSERT_TRUE(notified()); |
185 ASSERT_FALSE(IsVirtualKeyboardSuppressed()); | 185 ASSERT_FALSE(IsVirtualKeyboardSuppressed()); |
186 } | 186 } |
187 | 187 |
| 188 // Tests handling multiple keyboards. Catches crbug.com/430252 |
| 189 TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) { |
| 190 std::vector<ui::KeyboardDevice> keyboards; |
| 191 keyboards.push_back(ui::KeyboardDevice( |
| 192 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard")); |
| 193 keyboards.push_back(ui::KeyboardDevice( |
| 194 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); |
| 195 keyboards.push_back(ui::KeyboardDevice( |
| 196 3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard")); |
| 197 UpdateKeyboardDevices(keyboards); |
| 198 ASSERT_FALSE(keyboard::IsKeyboardEnabled()); |
| 199 } |
| 200 |
188 } // namespace test | 201 } // namespace test |
189 } // namespace ash | 202 } // namespace ash |
OLD | NEW |