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 "ui/events/x/device_data_manager_x11.h" | 5 #include "ui/events/devices/x11/device_data_manager_x11.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 // Generically-named #defines from Xlib that conflict with symbols in GTest. | 9 // Generically-named #defines from Xlib that conflict with symbols in GTest. |
10 #undef Bool | 10 #undef Bool |
11 #undef None | 11 #undef None |
12 | 12 |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "ui/events/device_hotplug_event_observer.h" | 14 #include "ui/events/devices/device_hotplug_event_observer.h" |
15 #include "ui/events/input_device.h" | 15 #include "ui/events/devices/input_device.h" |
16 #include "ui/events/input_device_event_observer.h" | 16 #include "ui/events/devices/input_device_event_observer.h" |
17 #include "ui/events/keyboard_device.h" | 17 #include "ui/events/devices/keyboard_device.h" |
18 #include "ui/events/touchscreen_device.h" | 18 #include "ui/events/devices/touchscreen_device.h" |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 namespace test { | 21 namespace test { |
22 namespace { | 22 namespace { |
23 | 23 |
24 class TestInputDeviceObserver : public InputDeviceEventObserver { | 24 class TestInputDeviceObserver : public InputDeviceEventObserver { |
25 public: | 25 public: |
26 explicit TestInputDeviceObserver(DeviceDataManagerX11* manager) | 26 explicit TestInputDeviceObserver(DeviceDataManagerX11* manager) |
27 : manager_(manager), change_notified_(false) { | 27 : manager_(manager), change_notified_(false) { |
28 if (manager_) | 28 if (manager_) |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Replug in the first device. Should be notified of the new device. | 173 // Replug in the first device. Should be notified of the new device. |
174 SetKeyboardDevices(all_keyboards); | 174 SetKeyboardDevices(all_keyboards); |
175 EXPECT_TRUE(observer.change_notified()); | 175 EXPECT_TRUE(observer.change_notified()); |
176 devices = manager->keyboard_devices(); | 176 devices = manager->keyboard_devices(); |
177 // Both devices now present. | 177 // Both devices now present. |
178 EXPECT_EQ(2u, devices.size()); | 178 EXPECT_EQ(2u, devices.size()); |
179 } | 179 } |
180 | 180 |
181 } // namespace test | 181 } // namespace test |
182 } // namespace ui | 182 } // namespace ui |
OLD | NEW |