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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/test/test_event_utils.h"
6
7 #include <X11/extensions/XInput.h>
8 #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
9
10 #include "ui/base/x/x11_util.h"
11
12 namespace views {
13
14 base::NativeEvent GetNativeEventForTesting() {
15 XEvent* event = new XEvent;
16 memset(event, 0, sizeof(*event));
17 XGenericEventCookie* cookie = &(event->xcookie);
18 cookie->type = GenericEvent;
19 XIDeviceEvent* dev_event = new XIDeviceEvent;
20 memset(dev_event, 0, sizeof(*dev_event));
21 cookie->data = dev_event;
22 return event;
23 }
24
25 void SetNativeEventLocationForTesting(const base::NativeEvent& native_event,
26 int x, int y) {
27 XIDeviceEvent* xievent =
28 static_cast<XIDeviceEvent*>(native_event->xcookie.data);
29 xievent->event_x = x;
30 xievent->event_y = y;
31 return;
32 }
33
34 } // namespace views
OLDNEW
« 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