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

Unified Diff: ui/events/event_unittest.cc

Issue 822803005: Correct missing radius in ui::TouchEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_unittest.cc
diff --git a/ui/events/event_unittest.cc b/ui/events/event_unittest.cc
index 1debef9a1e83bd51bede619c3181a90ea267eb35..25e6a1bc1830745a7cdc46fb5e20b35233e70df9 100644
--- a/ui/events/event_unittest.cc
+++ b/ui/events/event_unittest.cc
@@ -498,4 +498,20 @@ TEST(EventTest, AutoRepeat) {
}
#endif // USE_X11 || OS_WIN
+TEST(EventTest, TouchEventRadiusDefaultsToOtherAxis) {
+ const base::TimeDelta time = base::TimeDelta::FromMilliseconds(0);
+ const float nonZeroLength1 = 30;
+ const float nonZeroLength2 = 46;
sadrul 2015/01/13 21:32:42 non_zero_length*
tdresser 2015/01/13 21:44:10 Done.
+
+ TouchEvent event1(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time,
+ nonZeroLength1, 0, 0, 0);
+ DCHECK_EQ(nonZeroLength1, event1.radius_x());
+ DCHECK_EQ(nonZeroLength1, event1.radius_y());
+
+ TouchEvent event2(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0), 0, 0, time,
+ 0, nonZeroLength2, 0, 0);
+ DCHECK_EQ(nonZeroLength2, event2.radius_x());
+ DCHECK_EQ(nonZeroLength2, event2.radius_y());
+}
+
} // namespace ui
« no previous file with comments | « ui/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698