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

Unified Diff: views/test/test_event_utils_x.cc

Issue 8521001: Touch to Mouse conversion validation of views::GestureManager (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Incorporated Rob's comments Created 9 years, 1 month 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
Index: views/test/test_event_utils_x.cc
diff --git a/views/test/test_event_utils_x.cc b/views/test/test_event_utils_x.cc
new file mode 100644
index 0000000000000000000000000000000000000000..908446f5a9d88064f4e1daa5a48dfa541b4b5f5f
--- /dev/null
+++ b/views/test/test_event_utils_x.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "views/test/test_event_utils.h"
+
+#include <X11/extensions/XInput.h>
+#include <X11/extensions/XInput2.h>
rjkroege 2011/11/12 16:11:35 FYI: It has been the case that not all the builder
Gajen 2011/11/14 12:10:17 AFAIK, USE_XI2_MT flag switch on X2.1 and X2.0 is
+
+#include "ui/base/x/x11_util.h"
+
+namespace views {
+
+base::NativeEvent GetNativeEventForTesting() {
+ XEvent* event = new XEvent;
+ memset(event, 0, sizeof(*event));
+ XGenericEventCookie* cookie = &(event->xcookie);
+ cookie->type = GenericEvent;
+ XIDeviceEvent* dev_event = new XIDeviceEvent;
+ memset(dev_event, 0, sizeof(*dev_event));
+ cookie->data = dev_event;
+ return event;
+}
+
+void SetNativeEventLocationForTesting(const base::NativeEvent& native_event,
+ int x, int y) {
+ XIDeviceEvent* xievent =
+ static_cast<XIDeviceEvent*>(native_event->xcookie.data);
+ xievent->event_x = x;
+ xievent->event_y = y;
+ return;
+}
+
+} // namespace views
« no previous file with comments | « views/test/test_event_utils.h ('k') | views/view_unittest.cc » ('j') | views/view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698