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

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 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/test/test_event_utils.h ('k') | views/view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/XInput2.h>
8
9 #include "ui/base/x/x11_util.h"
10
11 namespace views {
12
13 base::NativeEvent GetNativeEventForTesting() {
14 XEvent* event = new XEvent;
15 memset(event, 0, sizeof(*event));
16 XGenericEventCookie* cookie = &(event->xcookie);
17 cookie->type = GenericEvent;
18 XIDeviceEvent* dev_event = new XIDeviceEvent;
19 memset(dev_event, 0, sizeof(*dev_event));
20 cookie->data = dev_event;
21 return event;
22 }
23
24 void SetNativeEventLocationForTesting(const base::NativeEvent& native_event,
25 int x, int y) {
26 XIDeviceEvent* xievent =
27 static_cast<XIDeviceEvent*>(native_event->xcookie.data);
28 xievent->event_x = x;
29 xievent->event_y = y;
30 return;
31 }
32
33 } // namespace views
OLDNEW
« 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