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

Unified Diff: ui/events/android/motion_event_android_unittest.cc

Issue 2770613002: Forward GenericMotionEvent to EventForwarder (Closed)
Patch Set: comments Created 3 years, 9 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/android/motion_event_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/android/motion_event_android_unittest.cc
diff --git a/ui/events/android/motion_event_android_unittest.cc b/ui/events/android/motion_event_android_unittest.cc
index 5ba65caf58baf027e0562175dadb06f9ff105518..0df61228edcbc57726c2282ea9f6dbab529897da 100644
--- a/ui/events/android/motion_event_android_unittest.cc
+++ b/ui/events/android/motion_event_android_unittest.cc
@@ -49,10 +49,10 @@ TEST(MotionEventAndroidTest, Constructor) {
int history_size = 0;
int action_index = -1;
MotionEventAndroid event(
- kPixToDip, base::android::AttachCurrentThread(), nullptr, event_time_ms,
- kAndroidActionDown, pointer_count, history_size, action_index,
- kAndroidActionButton, kAndroidButtonPrimary, kAndroidAltKeyDown,
- raw_offset, -raw_offset, &p0, &p1);
+ base::android::AttachCurrentThread(), nullptr, kPixToDip, 0.f, 0.f, 0.f,
+ event_time_ms, kAndroidActionDown, pointer_count, history_size,
+ action_index, kAndroidActionButton, kAndroidButtonPrimary,
+ kAndroidAltKeyDown, raw_offset, -raw_offset, &p0, &p1);
EXPECT_EQ(MotionEvent::ACTION_DOWN, event.GetAction());
EXPECT_EQ(event_time, event.GetEventTime());
@@ -86,9 +86,9 @@ TEST(MotionEventAndroidTest, Clone) {
const int pointer_count = 1;
MotionEventAndroid::Pointer p0(
1, 13.7f, -7.13f, 5.3f, 1.2f, 0.1f, 0.2f, kAndroidToolTypeFinger);
- MotionEventAndroid event(kPixToDip, base::android::AttachCurrentThread(),
- nullptr, 0, kAndroidActionDown, pointer_count, 0, 0,
- 0, 0, 0, 0, 0, &p0, nullptr);
+ MotionEventAndroid event(base::android::AttachCurrentThread(), nullptr,
+ kPixToDip, 0, 0, 0, 0, kAndroidActionDown,
+ pointer_count, 0, 0, 0, 0, 0, 0, 0, &p0, nullptr);
std::unique_ptr<MotionEvent> clone = event.Clone();
EXPECT_EQ(ui::test::ToString(event), ui::test::ToString(*clone));
@@ -99,9 +99,10 @@ TEST(MotionEventAndroidTest, Cancel) {
const int pointer_count = 1;
MotionEventAndroid::Pointer p0(
1, 13.7f, -7.13f, 5.3f, 1.2f, 0.1f, 0.2f, kAndroidToolTypeFinger);
- MotionEventAndroid event(kPixToDip, base::android::AttachCurrentThread(),
- nullptr, event_time_ms, kAndroidActionDown,
- pointer_count, 0, 0, 0, 0, 0, 0, 0, &p0, nullptr);
+ MotionEventAndroid event(base::android::AttachCurrentThread(), nullptr,
+ kPixToDip, 0, 0, 0, event_time_ms,
+ kAndroidActionDown, pointer_count, 0, 0, 0, 0, 0, 0,
+ 0, &p0, nullptr);
std::unique_ptr<MotionEvent> cancel_event = event.Cancel();
EXPECT_EQ(MotionEvent::ACTION_CANCEL, cancel_event->GetAction());
@@ -121,9 +122,9 @@ TEST(MotionEventAndroidTest, InvalidOrientationsSanitized) {
float orientation1 = std::numeric_limits<float>::quiet_NaN();
MotionEventAndroid::Pointer p0(0, 0, 0, 0, 0, orientation0, 0, 0);
MotionEventAndroid::Pointer p1(1, 0, 0, 0, 0, orientation1, 0, 0);
- MotionEventAndroid event(kPixToDip, base::android::AttachCurrentThread(),
- nullptr, 0, kAndroidActionDown, pointer_count, 0, 0,
- 0, 0, 0, 0, 0, &p0, &p1);
+ MotionEventAndroid event(base::android::AttachCurrentThread(), nullptr,
+ kPixToDip, 0, 0, 0, 0, kAndroidActionDown,
+ pointer_count, 0, 0, 0, 0, 0, 0, 0, &p0, &p1);
EXPECT_EQ(0.f, event.GetOrientation(0));
EXPECT_EQ(0.f, event.GetOrientation(1));
@@ -133,9 +134,10 @@ TEST(MotionEventAndroidTest, NonEmptyHistoryForNonMoveEventsSanitized) {
int pointer_count = 1;
size_t history_size = 5;
MotionEventAndroid::Pointer p0(0, 0, 0, 0, 0, 0, 0, 0);
- MotionEventAndroid event(kPixToDip, base::android::AttachCurrentThread(),
- nullptr, 0, kAndroidActionDown, pointer_count,
- history_size, 0, 0, 0, 0, 0, 0, &p0, nullptr);
+ MotionEventAndroid event(base::android::AttachCurrentThread(), nullptr,
+ kPixToDip, 0, 0, 0, 0, kAndroidActionDown,
+ pointer_count, history_size, 0, 0, 0, 0, 0, 0, &p0,
+ nullptr);
EXPECT_EQ(0U, event.GetHistorySize());
}
@@ -148,9 +150,10 @@ TEST(MotionEventAndroidTest, ActionIndexForPointerDown) {
int pointer_count = 2;
int history_size = 0;
int action_index = 1;
- MotionEventAndroid event(kPixToDip, base::android::AttachCurrentThread(),
- nullptr, 0, kAndroidActionPointerDown, pointer_count,
- history_size, action_index, 0, 0, 0, 0, 0, &p0, &p1);
+ MotionEventAndroid event(base::android::AttachCurrentThread(), nullptr,
+ kPixToDip, 0, 0, 0, 0, kAndroidActionPointerDown,
+ pointer_count, history_size, action_index, 0, 0, 0,
+ 0, 0, &p0, &p1);
EXPECT_EQ(MotionEvent::ACTION_POINTER_DOWN, event.GetAction());
EXPECT_EQ(action_index, event.GetActionIndex());
« no previous file with comments | « ui/events/android/motion_event_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698