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

Unified Diff: ui/events/devices/x11/device_data_manager_x11_unittest.cc

Issue 2028593004: Add new InputDeviceManager interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_keyboard
Patch Set: Fix windows compile error. 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
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.cc ('k') | ui/events/devices/x11/touch_factory_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/x11/device_data_manager_x11_unittest.cc
diff --git a/ui/events/devices/x11/device_data_manager_x11_unittest.cc b/ui/events/devices/x11/device_data_manager_x11_unittest.cc
index 9bb16524841db0be498e66585f559abff6ad1401..3472e636b27e256562bfecc67515a5e642ed5a97 100644
--- a/ui/events/devices/x11/device_data_manager_x11_unittest.cc
+++ b/ui/events/devices/x11/device_data_manager_x11_unittest.cc
@@ -81,14 +81,14 @@ TEST_F(DeviceDataManagerX11Test, NotifyOnDisable) {
2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
SetKeyboardDevices(keyboards);
EXPECT_TRUE(observer.change_notified());
- std::vector<InputDevice> devices = manager->keyboard_devices();
+ std::vector<InputDevice> devices = manager->GetKeyboardDevices();
EXPECT_EQ(keyboards.size(), devices.size());
observer.Reset();
// Disable the device, should be notified that the device list contains one
// less device.
manager->DisableDevice(2);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(1u, devices.size());
InputDevice device = devices.front();
EXPECT_EQ(1, device.id);
@@ -97,7 +97,7 @@ TEST_F(DeviceDataManagerX11Test, NotifyOnDisable) {
// more device.
manager->EnableDevice(2);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(keyboards.size(), devices.size());
}
@@ -112,32 +112,32 @@ TEST_F(DeviceDataManagerX11Test, TestMultipleDisable) {
2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
SetKeyboardDevices(keyboards);
EXPECT_TRUE(observer.change_notified());
- std::vector<InputDevice> devices = manager->keyboard_devices();
+ std::vector<InputDevice> devices = manager->GetKeyboardDevices();
EXPECT_EQ(keyboards.size(), devices.size());
observer.Reset();
// Disable the device, should be notified that the device list contains one
// less device.
manager->DisableDevice(1);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(1u, devices.size());
observer.Reset();
// Disable the second device, should be notified that the device list empty.
manager->DisableDevice(2);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(0u, devices.size());
observer.Reset();
// Enable the first device, should be notified that one device present.
manager->EnableDevice(1);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(1u, devices.size());
observer.Reset();
// Enable the second device, should be notified that both devices present.
manager->EnableDevice(2);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(2u, devices.size());
}
@@ -151,13 +151,13 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) {
2, ui::InputDeviceType::INPUT_DEVICE_INTERNAL, "Keyboard"));
SetKeyboardDevices(all_keyboards);
EXPECT_TRUE(observer.change_notified());
- std::vector<InputDevice> devices = manager->keyboard_devices();
+ std::vector<InputDevice> devices = manager->GetKeyboardDevices();
EXPECT_EQ(all_keyboards.size(), devices.size());
observer.Reset();
// Expect to be notified that the device is no longer available.
manager->DisableDevice(2);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
EXPECT_EQ(1u, devices.size());
observer.Reset();
// Unplug the disabled device. Should not be notified, since the active list
@@ -170,7 +170,7 @@ TEST_F(DeviceDataManagerX11Test, UnblockOnDeviceUnplugged) {
// Replug in the first device. Should be notified of the new device.
SetKeyboardDevices(all_keyboards);
EXPECT_TRUE(observer.change_notified());
- devices = manager->keyboard_devices();
+ devices = manager->GetKeyboardDevices();
// Both devices now present.
EXPECT_EQ(2u, devices.size());
}
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.cc ('k') | ui/events/devices/x11/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698