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

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 gyp changes 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
« no previous file with comments | « views/test/test_event_utils.h ('k') | views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..61ec5c39ae4494df6c9ddbb5c4c364d64c5eb401
--- /dev/null
+++ b/views/test/test_event_utils_x.cc
@@ -0,0 +1,33 @@
+// 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/XInput2.h>
+
+#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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698