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/devices/x11/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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 ~TestInputDeviceObserver() override { | 32 ~TestInputDeviceObserver() override { |
33 if (manager_) | 33 if (manager_) |
34 manager_->RemoveObserver(this); | 34 manager_->RemoveObserver(this); |
35 } | 35 } |
36 | 36 |
37 // InputDeviceEventObserver implementation. | 37 // InputDeviceEventObserver implementation. |
38 void OnTouchscreenDeviceConfigurationChanged() override {} | 38 void OnTouchscreenDeviceConfigurationChanged() override {} |
39 void OnKeyboardDeviceConfigurationChanged() override { | 39 void OnKeyboardDeviceConfigurationChanged() override { |
40 change_notified_ = true; | 40 change_notified_ = true; |
41 } | 41 } |
| 42 void OnMouseDeviceConfigurationChanged() override {} |
| 43 void OnTouchpadDeviceConfigurationChanged() override {} |
42 | 44 |
43 int change_notified() const { return change_notified_; } | 45 int change_notified() const { return change_notified_; } |
44 void Reset() { change_notified_ = false; } | 46 void Reset() { change_notified_ = false; } |
45 | 47 |
46 private: | 48 private: |
47 DeviceDataManager* manager_; | 49 DeviceDataManager* manager_; |
48 bool change_notified_; | 50 bool change_notified_; |
49 | 51 |
50 DISALLOW_COPY_AND_ASSIGN(TestInputDeviceObserver); | 52 DISALLOW_COPY_AND_ASSIGN(TestInputDeviceObserver); |
51 }; | 53 }; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Replug in the first device. Should be notified of the new device. | 175 // Replug in the first device. Should be notified of the new device. |
174 SetKeyboardDevices(all_keyboards); | 176 SetKeyboardDevices(all_keyboards); |
175 EXPECT_TRUE(observer.change_notified()); | 177 EXPECT_TRUE(observer.change_notified()); |
176 devices = manager->keyboard_devices(); | 178 devices = manager->keyboard_devices(); |
177 // Both devices now present. | 179 // Both devices now present. |
178 EXPECT_EQ(2u, devices.size()); | 180 EXPECT_EQ(2u, devices.size()); |
179 } | 181 } |
180 | 182 |
181 } // namespace test | 183 } // namespace test |
182 } // namespace ui | 184 } // namespace ui |
OLD | NEW |