Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: ash/virtual_keyboard_controller_unittest.cc

Issue 703703004: Fix infinite loop causing iterator to go out of bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Const Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/virtual_keyboard_controller_unittest.cc
diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc
index ccfdab5f6250f073f66ae2e638fa704be5b2db61..dc45cc1413f4feeeff2d162441b667bbc1714822 100644
--- a/ash/virtual_keyboard_controller_unittest.cc
+++ b/ash/virtual_keyboard_controller_unittest.cc
@@ -185,5 +185,18 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
}
+// Tests handling multiple keyboards. Catches crbug.com/430252
+TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) {
+ std::vector<ui::KeyboardDevice> keyboards;
+ keyboards.push_back(ui::KeyboardDevice(
+ 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
+ keyboards.push_back(ui::KeyboardDevice(
+ 2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
+ keyboards.push_back(ui::KeyboardDevice(
+ 3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
+ UpdateKeyboardDevices(keyboards);
+ ASSERT_FALSE(keyboard::IsKeyboardEnabled());
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698