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

Unified Diff: ash/virtual_keyboard_controller_unittest.cc

Issue 2019413002: Remove KeyboardDevice class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
Index: ash/virtual_keyboard_controller_unittest.cc
diff --git a/ash/virtual_keyboard_controller_unittest.cc b/ash/virtual_keyboard_controller_unittest.cc
index bdae09ec4223547bc2e90577720841eafa294403..a9ee7e69239ea83c7d5805322586cba1086a70cb 100644
--- a/ash/virtual_keyboard_controller_unittest.cc
+++ b/ash/virtual_keyboard_controller_unittest.cc
@@ -17,7 +17,6 @@
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
#include "ui/events/devices/input_device.h"
-#include "ui/events/devices/keyboard_device.h"
#include "ui/events/devices/touchscreen_device.h"
#include "ui/keyboard/keyboard_export.h"
#include "ui/keyboard/keyboard_switches.h"
@@ -38,7 +37,7 @@ class VirtualKeyboardControllerTest : public AshTestBase {
manager->OnTouchscreenDevicesUpdated(touchscreen_devices);
}
- void UpdateKeyboardDevices(std::vector<ui::KeyboardDevice> keyboard_devices) {
+ void UpdateKeyboardDevices(std::vector<ui::InputDevice> keyboard_devices) {
ui::DeviceHotplugEventObserver* manager =
ui::DeviceDataManager::GetInstance();
manager->OnKeyboardDevicesUpdated(keyboard_devices);
@@ -55,7 +54,7 @@ class VirtualKeyboardControllerTest : public AshTestBase {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
keyboard::switches::kDisableSmartVirtualKeyboard);
AshTestBase::SetUp();
- UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>());
+ UpdateKeyboardDevices(std::vector<ui::InputDevice>());
UpdateTouchscreenDevices(std::vector<ui::TouchscreenDevice>());
}
@@ -83,8 +82,8 @@ class MockEventBlocker : public ScopedDisableInternalMouseAndKeyboard {
public:
MockEventBlocker() {}
~MockEventBlocker() override {
- std::vector<ui::KeyboardDevice> keyboards;
- keyboards.push_back(ui::KeyboardDevice(
+ std::vector<ui::InputDevice> keyboards;
sky 2016/05/31 18:13:45 input_devices or maybe keyboard_devices?
kylechar 2016/05/31 19:31:11 Done.
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
ui::DeviceHotplugEventObserver* manager =
ui::DeviceDataManager::GetInstance();
@@ -117,7 +116,7 @@ class VirtualKeyboardControllerAutoTest : public VirtualKeyboardControllerTest,
AshTestBase::SetUp();
// Set the current list of devices to empty so that they don't interfere
// with the test.
- UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>());
+ UpdateKeyboardDevices(std::vector<ui::InputDevice>());
UpdateTouchscreenDevices(std::vector<ui::TouchscreenDevice>());
Shell::GetInstance()->system_tray_notifier()->AddVirtualKeyboardObserver(
this);
@@ -161,13 +160,13 @@ TEST_F(VirtualKeyboardControllerAutoTest, DisabledIfInternalKeyboardPresent) {
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(
+ std::vector<ui::InputDevice> keyboards;
sky 2016/05/31 18:13:45 keyboard_devices?
kylechar 2016/05/31 19:31:11 Done.
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
// Remove the internal keyboard. Virtual keyboard should now show.
- UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>());
+ UpdateKeyboardDevices(std::vector<ui::InputDevice>());
EXPECT_TRUE(keyboard::IsKeyboardEnabled());
// Replug in the internal keyboard. Virtual keyboard should hide.
UpdateKeyboardDevices(keyboards);
@@ -193,8 +192,8 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
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(
+ std::vector<ui::InputDevice> keyboards;
sky 2016/05/31 18:13:45 keyboard_devices?
kylechar 2016/05/31 19:31:12 Done.
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
@@ -219,7 +218,7 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
// Remove external keyboard. Should be notified that the keyboard is not
// suppressed.
ResetObserver();
- UpdateKeyboardDevices(std::vector<ui::KeyboardDevice>());
+ UpdateKeyboardDevices(std::vector<ui::InputDevice>());
ASSERT_TRUE(keyboard::IsKeyboardEnabled());
ASSERT_TRUE(notified());
ASSERT_FALSE(IsVirtualKeyboardSuppressed());
@@ -227,12 +226,12 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedIfExternalKeyboardPresent) {
// Tests handling multiple keyboards. Catches crbug.com/430252
TEST_F(VirtualKeyboardControllerAutoTest, HandleMultipleKeyboardsPresent) {
- std::vector<ui::KeyboardDevice> keyboards;
- keyboards.push_back(ui::KeyboardDevice(
+ std::vector<ui::InputDevice> keyboards;
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "keyboard"));
- keyboards.push_back(ui::KeyboardDevice(
+ keyboards.push_back(ui::InputDevice(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
- keyboards.push_back(ui::KeyboardDevice(
+ keyboards.push_back(ui::InputDevice(
3, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
@@ -245,8 +244,8 @@ TEST_F(VirtualKeyboardControllerAutoTest, EnabledDuringMaximizeMode) {
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(
+ std::vector<ui::InputDevice> keyboards;
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboards);
ASSERT_FALSE(keyboard::IsKeyboardEnabled());
@@ -269,10 +268,10 @@ TEST_F(VirtualKeyboardControllerAutoTest, SuppressedInMaximizedMode) {
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(
+ std::vector<ui::InputDevice> keyboards;
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
- keyboards.push_back(ui::KeyboardDevice(
+ keyboards.push_back(ui::InputDevice(
2, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "Keyboard"));
UpdateKeyboardDevices(keyboards);
// Toggle maximized mode on.
@@ -338,8 +337,8 @@ TEST_F(VirtualKeyboardControllerAlwaysEnabledTest, DoesNotSuppressKeyboard) {
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(
+ std::vector<ui::InputDevice> keyboards;
+ keyboards.push_back(ui::InputDevice(
1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL, "keyboard"));
UpdateKeyboardDevices(keyboards);
ASSERT_TRUE(keyboard::IsKeyboardEnabled());

Powered by Google App Engine
This is Rietveld 408576698