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

Unified Diff: ui/events/x/device_data_manager.h

Issue 95403006: x11: Cleanup how valuators are set for X events in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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/test/events_test_utils_x11.cc ('k') | ui/events/x/device_data_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/device_data_manager.h
diff --git a/ui/events/x/device_data_manager.h b/ui/events/x/device_data_manager.h
index 62a95f88efe630456e3a92fbf9d3ed177482e117..aff064935718000d97f23a866178e0629fe4e810 100644
--- a/ui/events/x/device_data_manager.h
+++ b/ui/events/x/device_data_manager.h
@@ -215,23 +215,17 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
double* min,
double* max);
- // Setups relevant valuator informations for device ids in the list |devices|.
+ // Sets up relevant valuator informations for device ids in the device lists.
// This function is only for test purpose. It does not query the X server for
// the actual device info, but rather inits the relevant valuator structures
- // to have safe default values for testing. |cmt_devices| and |touchpads|
- // should only contain device ids in |devices|.
- void SetDeviceListForTest(const std::vector<unsigned int>& devices,
- const std::vector<unsigned int>& cmt_devices,
- const std::vector<unsigned int>& touchpads);
-
- // Setups device with |deviceid| to have valuator with type |data_type|,
- // at index |val_index|, and with |min|/|max| values. This is only for test
- // purpose.
- void SetDeviceValuatorForTest(int deviceid,
- int val_index,
- DataType data_type,
- double min,
- double max);
+ // to have safe default values for testing.
+ void SetDeviceListForTest(const std::vector<unsigned int>& touchscreen,
+ const std::vector<unsigned int>& cmt_devices);
+
+ void SetValuatorDataForTest(XIDeviceEvent* xievent,
+ DataType type,
+ double value);
+
private:
// Requirement for Singleton.
friend struct DefaultSingletonTraits<DeviceDataManager>;
@@ -245,6 +239,12 @@ class EVENTS_BASE_EXPORT DeviceDataManager {
// Check if an XI event contains data of the specified type.
bool HasEventData(const XIDeviceEvent* xiev, const DataType type) const;
+ void InitializeValuatorsForTest(int deviceid,
+ int start_valuator,
+ int end_valuator,
+ double min_value,
+ double max_value);
+
static const int kMaxDeviceNum = 128;
static const int kMaxXIEventType = XI_LASTEVENT + 1;
static const int kMaxSlotNum = 10;
« no previous file with comments | « ui/events/test/events_test_utils_x11.cc ('k') | ui/events/x/device_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698