| Index: ash/virtual_keyboard_controller_unittest.cc
|
| diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc
|
| index f7a59ef7e72b1b5f28e7cf1ed7a710ca81ac26a0..7ca7a2aeef814df2cb3c1a6369f1f9241673811f 100644
|
| --- a/ash/virtual_keyboard_controller_unittest.cc
|
| +++ b/ash/virtual_keyboard_controller_unittest.cc
|
| @@ -46,8 +46,9 @@
|
| // Sets the event blocker on the maximized window controller.
|
| void SetEventBlocker(
|
| scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker) {
|
| - Shell::GetInstance()->maximize_mode_controller()->event_blocker_ =
|
| - blocker.Pass();
|
| + Shell::GetInstance()
|
| + ->maximize_mode_controller()
|
| + ->event_blocker_ = blocker.Pass();
|
| }
|
|
|
| void SetUp() override {
|
| @@ -83,8 +84,8 @@
|
| MockEventBlocker() {}
|
| ~MockEventBlocker() override {
|
| std::vector<ui::KeyboardDevice> keyboards;
|
| - keyboards.push_back(ui::KeyboardDevice(
|
| - 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
|
| ui::DeviceHotplugEventObserver* manager =
|
| ui::DeviceDataManager::GetInstance();
|
| manager->OnKeyboardDevicesUpdated(keyboards);
|
| @@ -101,8 +102,8 @@
|
| Shell::GetInstance()
|
| ->maximize_mode_controller()
|
| ->EnableMaximizeModeWindowManager(true);
|
| - scoped_ptr<ScopedDisableInternalMouseAndKeyboard> blocker(
|
| - new MockEventBlocker);
|
| + scoped_ptr<ScopedDisableInternalMouseAndKeyboard>
|
| + blocker(new MockEventBlocker);
|
| SetEventBlocker(blocker.Pass());
|
| }
|
|
|
| @@ -156,13 +157,12 @@
|
| // present and maximized mode is disabled.
|
| TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
|
| std::vector<ui::TouchscreenDevice> screens;
|
| - screens.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
| - "Touchscreen", gfx::Size(1024, 768), 0));
|
| - UpdateTouchscreenDevices(screens);
|
| - std::vector<ui::KeyboardDevice> keyboards;
|
| - keyboards.push_back(ui::KeyboardDevice(
|
| - 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
|
| + screens.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
|
| + UpdateTouchscreenDevices(screens);
|
| + std::vector<ui::KeyboardDevice> keyboards;
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
| // Remove the internal keyboard. Virtual keyboard should now show.
|
| @@ -176,9 +176,8 @@
|
| TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfNoTouchScreen) {
|
| std::vector<ui::TouchscreenDevice> devices;
|
| // Add a touchscreen. Keyboard should deploy.
|
| - devices.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
|
| - "Touchscreen", gfx::Size(800, 600), 0));
|
| + devices.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, gfx::Size(800, 600), 0));
|
| UpdateTouchscreenDevices(devices);
|
| EXPECT_TRUE(keyboard::IsKeyboardEnabled());
|
| // Remove touchscreen. Keyboard should hide.
|
| @@ -188,13 +187,12 @@
|
|
|
| TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
|
| std::vector<ui::TouchscreenDevice> screens;
|
| - screens.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
| - "Touchscreen", gfx::Size(1024, 768), 0));
|
| - UpdateTouchscreenDevices(screens);
|
| - std::vector<ui::KeyboardDevice> keyboards;
|
| - keyboards.push_back(ui::KeyboardDevice(
|
| - 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
| + screens.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
|
| + UpdateTouchscreenDevices(screens);
|
| + std::vector<ui::KeyboardDevice> keyboards;
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
| ASSERT_TRUE(notified());
|
| @@ -227,12 +225,12 @@
|
| // 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"));
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
| }
|
| @@ -240,13 +238,12 @@
|
| // Tests maximized mode interaction without disabling the internal keyboard.
|
| TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringMaximizeMode) {
|
| std::vector<ui::TouchscreenDevice> screens;
|
| - screens.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
| - "Touchscreen", gfx::Size(1024, 768), 0));
|
| - UpdateTouchscreenDevices(screens);
|
| - std::vector<ui::KeyboardDevice> keyboards;
|
| - keyboards.push_back(ui::KeyboardDevice(
|
| - 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
|
| + screens.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
|
| + UpdateTouchscreenDevices(screens);
|
| + std::vector<ui::KeyboardDevice> keyboards;
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| ASSERT_FALSE(keyboard::IsKeyboardEnabled());
|
| // Toggle maximized mode on.
|
| @@ -264,15 +261,14 @@
|
| // Tests that keyboard gets suppressed in maximized mode.
|
| TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
|
| std::vector<ui::TouchscreenDevice> screens;
|
| - screens.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
| - "Touchscreen", gfx::Size(1024, 768), 0));
|
| - UpdateTouchscreenDevices(screens);
|
| - 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"));
|
| + screens.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
|
| + UpdateTouchscreenDevices(screens);
|
| + std::vector<ui::KeyboardDevice> keyboards;
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL));
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| // Toggle maximized mode on.
|
| Shell::GetInstance()
|
| @@ -333,13 +329,12 @@
|
| // keyboard always enabled flag is active.
|
| TEST_F(VirtualKeyboardControllerAlwaysEnabledTest, DoesNotSuppressKeyboard) {
|
| std::vector<ui::TouchscreenDevice> screens;
|
| - screens.push_back(
|
| - ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL,
|
| - "Touchscreen", gfx::Size(1024, 768), 0));
|
| - UpdateTouchscreenDevices(screens);
|
| - std::vector<ui::KeyboardDevice> keyboards;
|
| - keyboards.push_back(ui::KeyboardDevice(
|
| - 1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
|
| + screens.push_back(ui::TouchscreenDevice(
|
| + 1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, gfx::Size(1024, 768), 0));
|
| + UpdateTouchscreenDevices(screens);
|
| + std::vector<ui::KeyboardDevice> keyboards;
|
| + keyboards.push_back(
|
| + ui::KeyboardDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL));
|
| UpdateKeyboardDevices(keyboards);
|
| ASSERT_TRUE(keyboard::IsKeyboardEnabled());
|
| }
|
|
|