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

Side by Side Diff: ui/events/x/events_x_unittest.cc

Issue 24482004: events: Make platform specific events code into ui/events/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months 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 | « ui/events/x/events_x.cc ('k') | ui/events/x/events_x_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cstring> 5 #include <cstring>
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 // Generically-named #defines from Xlib that conflict with symbols in GTest. 10 // Generically-named #defines from Xlib that conflict with symbols in GTest.
11 #undef Bool 11 #undef Bool
12 #undef None 12 #undef None
13 13
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/base/touch/touch_factory_x11.h" 15 #include "ui/base/touch/touch_factory_x11.h"
16 #include "ui/base/x/device_data_manager.h"
17 #include "ui/events/event.h" 16 #include "ui/events/event.h"
18 #include "ui/events/event_constants.h" 17 #include "ui/events/event_constants.h"
19 #include "ui/events/event_utils.h" 18 #include "ui/events/event_utils.h"
19 #include "ui/events/x/device_data_manager.h"
20 #include "ui/gfx/point.h" 20 #include "ui/gfx/point.h"
21 21
22 namespace ui { 22 namespace ui {
23 23
24 namespace { 24 namespace {
25 25
26 // Initializes the passed-in Xlib event. 26 // Initializes the passed-in Xlib event.
27 void InitButtonEvent(XEvent* event, 27 void InitButtonEvent(XEvent* event,
28 bool is_press, 28 bool is_press,
29 const gfx::Point& location, 29 const gfx::Point& location,
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 EXPECT_EQ(ui::ET_TOUCH_RELEASED, ui::EventTypeFromNative(event)); 326 EXPECT_EQ(ui::ET_TOUCH_RELEASED, ui::EventTypeFromNative(event));
327 EXPECT_EQ("200,200", ui::EventLocationFromNative(event).ToString()); 327 EXPECT_EQ("200,200", ui::EventLocationFromNative(event).ToString());
328 EXPECT_EQ(GetTouchId(event), 1); 328 EXPECT_EQ(GetTouchId(event), 1);
329 EXPECT_EQ(GetTouchRadiusX(event), 25); 329 EXPECT_EQ(GetTouchRadiusX(event), 25);
330 EXPECT_FLOAT_EQ(GetTouchAngle(event), 0.45f); 330 EXPECT_FLOAT_EQ(GetTouchAngle(event), 0.45f);
331 EXPECT_FLOAT_EQ(GetTouchForce(event), 0.5f); 331 EXPECT_FLOAT_EQ(GetTouchForce(event), 0.5f);
332 DestroyTouchEvent(event); 332 DestroyTouchEvent(event);
333 } 333 }
334 #endif 334 #endif
335 } // namespace ui 335 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/x/events_x.cc ('k') | ui/events/x/events_x_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698