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