Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 | 124 |
| 125 const GestureEventData* GetActiveScrollBeginEvent() const { | 125 const GestureEventData* GetActiveScrollBeginEvent() const { |
| 126 return active_scroll_begin_event_ ? active_scroll_begin_event_.get() : NULL; | 126 return active_scroll_begin_event_ ? active_scroll_begin_event_.get() : NULL; |
| 127 } | 127 } |
| 128 | 128 |
| 129 const GestureProvider::Config& GetDefaultConfig() const { | 129 const GestureProvider::Config& GetDefaultConfig() const { |
| 130 static GestureProvider::Config sConfig = CreateDefaultConfig(); | 130 static GestureProvider::Config sConfig = CreateDefaultConfig(); |
| 131 return sConfig; | 131 return sConfig; |
| 132 } | 132 } |
| 133 | 133 |
| 134 int GetTouchSlop() const { | 134 float GetTouchSlop() const { |
| 135 return GetDefaultConfig().gesture_detector_config.scaled_touch_slop; | 135 return GetDefaultConfig().gesture_detector_config.touch_slop; |
| 136 } | 136 } |
| 137 | 137 |
| 138 base::TimeDelta GetLongPressTimeout() const { | 138 base::TimeDelta GetLongPressTimeout() const { |
| 139 return GetDefaultConfig().gesture_detector_config.longpress_timeout; | 139 return GetDefaultConfig().gesture_detector_config.longpress_timeout; |
| 140 } | 140 } |
| 141 | 141 |
| 142 base::TimeDelta GetShowPressTimeout() const { | 142 base::TimeDelta GetShowPressTimeout() const { |
| 143 return GetDefaultConfig().gesture_detector_config.showpress_timeout; | 143 return GetDefaultConfig().gesture_detector_config.showpress_timeout; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SetBeginEndTypesEnabled(bool enabled) { | 146 void SetBeginEndTypesEnabled(bool enabled) { |
| 147 GestureProvider::Config config = GetDefaultConfig(); | 147 GestureProvider::Config config = GetDefaultConfig(); |
| 148 config.gesture_begin_end_types_enabled = true; | 148 config.gesture_begin_end_types_enabled = true; |
| 149 gesture_provider_.reset(new GestureProvider(config, this)); | 149 gesture_provider_.reset(new GestureProvider(config, this)); |
| 150 gesture_provider_->SetMultiTouchSupportEnabled(false); | 150 gesture_provider_->SetMultiTouchSupportEnabled(false); |
| 151 } | 151 } |
| 152 | 152 |
| 153 protected: | 153 protected: |
| 154 void CheckScrollEventSequenceForEndActionType( | 154 void CheckScrollEventSequenceForEndActionType( |
| 155 MotionEvent::Action end_action_type) { | 155 MotionEvent::Action end_action_type) { |
| 156 base::TimeTicks event_time = base::TimeTicks::Now(); | 156 base::TimeTicks event_time = base::TimeTicks::Now(); |
| 157 const int scroll_to_x = kFakeCoordX + 100; | 157 const float scroll_to_x = kFakeCoordX + 100; |
| 158 const int scroll_to_y = kFakeCoordY + 100; | 158 const float scroll_to_y = kFakeCoordY + 100; |
| 159 int motion_event_id = 0; | 159 int motion_event_id = 0; |
| 160 | 160 |
| 161 MockMotionEvent event = | 161 MockMotionEvent event = |
| 162 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | 162 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); |
| 163 event.SetId(++motion_event_id); | 163 event.SetId(++motion_event_id); |
| 164 | 164 |
| 165 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 165 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 166 | 166 |
| 167 event = ObtainMotionEvent(event_time + kOneSecond, | 167 event = ObtainMotionEvent(event_time + kOneSecond, |
| 168 MotionEvent::ACTION_MOVE, | 168 MotionEvent::ACTION_MOVE, |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 500 kFakeCoordX, | 500 kFakeCoordX, |
| 501 kFakeCoordY - 200); | 501 kFakeCoordY - 200); |
| 502 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 502 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 503 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_PINCH_END)); | 503 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_PINCH_END)); |
| 504 EXPECT_EQ(ET_GESTURE_SCROLL_END, GetMostRecentGestureEventType()); | 504 EXPECT_EQ(ET_GESTURE_SCROLL_END, GetMostRecentGestureEventType()); |
| 505 } | 505 } |
| 506 | 506 |
| 507 // Generate a scroll gesture and verify that the resulting scroll motion event | 507 // Generate a scroll gesture and verify that the resulting scroll motion event |
| 508 // has both absolute and relative position information. | 508 // has both absolute and relative position information. |
| 509 TEST_F(GestureProviderTest, ScrollUpdateValues) { | 509 TEST_F(GestureProviderTest, ScrollUpdateValues) { |
| 510 const int delta_x = 16; | 510 const float delta_x = 16; |
| 511 const int delta_y = 84; | 511 const float delta_y = 84; |
| 512 | 512 |
| 513 const base::TimeTicks event_time = TimeTicks::Now(); | 513 const base::TimeTicks event_time = TimeTicks::Now(); |
| 514 | 514 |
| 515 MockMotionEvent event = | 515 MockMotionEvent event = |
| 516 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | 516 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); |
| 517 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 517 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 518 | 518 |
| 519 // Move twice so that we get two ET_GESTURE_SCROLL_UPDATE events and can | 519 // Move twice so that we get two ET_GESTURE_SCROLL_UPDATE events and can |
| 520 // compare the relative and absolute coordinates. | 520 // compare the relative and absolute coordinates. |
| 521 event = ObtainMotionEvent(event_time + kOneMicrosecond, | 521 event = ObtainMotionEvent(event_time + kOneMicrosecond, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 590 EXPECT_LE(gesture.details.scroll_y(), ((int)delta_y) + 1); | 590 EXPECT_LE(gesture.details.scroll_y(), ((int)delta_y) + 1); |
| 591 | 591 |
| 592 // And that there has been no horizontal motion at all. | 592 // And that there has been no horizontal motion at all. |
| 593 EXPECT_EQ(0, gesture.details.scroll_x()); | 593 EXPECT_EQ(0, gesture.details.scroll_x()); |
| 594 } | 594 } |
| 595 } | 595 } |
| 596 | 596 |
| 597 // Generate a scroll gesture and verify that the resulting scroll begin event | 597 // Generate a scroll gesture and verify that the resulting scroll begin event |
| 598 // has the expected hint values. | 598 // has the expected hint values. |
| 599 TEST_F(GestureProviderTest, ScrollBeginValues) { | 599 TEST_F(GestureProviderTest, ScrollBeginValues) { |
| 600 const int delta_x = 13; | 600 const float delta_x = 13; |
| 601 const int delta_y = 89; | 601 const float delta_y = 89; |
| 602 | 602 |
| 603 const base::TimeTicks event_time = TimeTicks::Now(); | 603 const base::TimeTicks event_time = TimeTicks::Now(); |
| 604 | 604 |
| 605 MockMotionEvent event = | 605 MockMotionEvent event = |
| 606 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | 606 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); |
| 607 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 607 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 608 | 608 |
| 609 // Move twice such that the first event isn't sufficient to start | 609 // Move twice such that the first event isn't sufficient to start |
| 610 // scrolling on it's own. | 610 // scrolling on it's own. |
| 611 event = ObtainMotionEvent(event_time + kOneMicrosecond, | 611 event = ObtainMotionEvent(event_time + kOneMicrosecond, |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 event.SetId(++motion_event_id); | 747 event.SetId(++motion_event_id); |
| 748 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 748 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 749 EXPECT_EQ(ET_GESTURE_SCROLL_END, GetMostRecentGestureEventType()); | 749 EXPECT_EQ(ET_GESTURE_SCROLL_END, GetMostRecentGestureEventType()); |
| 750 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); | 750 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); |
| 751 EXPECT_FALSE(gesture_provider_->IsDoubleTapInProgress()); | 751 EXPECT_FALSE(gesture_provider_->IsDoubleTapInProgress()); |
| 752 } | 752 } |
| 753 | 753 |
| 754 // Verify that the touch slop region is removed from the first scroll delta to | 754 // Verify that the touch slop region is removed from the first scroll delta to |
| 755 // avoid a jump when starting to scroll. | 755 // avoid a jump when starting to scroll. |
| 756 TEST_F(GestureProviderTest, TouchSlopRemovedFromScroll) { | 756 TEST_F(GestureProviderTest, TouchSlopRemovedFromScroll) { |
| 757 const int scaled_touch_slop = GetTouchSlop(); | 757 const float touch_slop = GetTouchSlop(); |
| 758 const int scroll_delta = 5; | 758 const float scroll_delta = 5; |
| 759 | 759 |
| 760 base::TimeTicks event_time = base::TimeTicks::Now(); | 760 base::TimeTicks event_time = base::TimeTicks::Now(); |
| 761 | 761 |
| 762 MockMotionEvent event = | 762 MockMotionEvent event = |
| 763 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | 763 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); |
| 764 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 764 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 765 | 765 |
| 766 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, | 766 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, |
| 767 MotionEvent::ACTION_MOVE, | 767 MotionEvent::ACTION_MOVE, |
| 768 kFakeCoordX, | 768 kFakeCoordX, |
| 769 kFakeCoordY + scaled_touch_slop + scroll_delta); | 769 kFakeCoordY + touch_slop + scroll_delta); |
| 770 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 770 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 771 | 771 |
| 772 EXPECT_EQ(ET_GESTURE_SCROLL_UPDATE, GetMostRecentGestureEventType()); | 772 EXPECT_EQ(ET_GESTURE_SCROLL_UPDATE, GetMostRecentGestureEventType()); |
| 773 GestureEventData gesture = GetMostRecentGestureEvent(); | 773 GestureEventData gesture = GetMostRecentGestureEvent(); |
| 774 EXPECT_EQ(0, gesture.details.scroll_x()); | 774 EXPECT_EQ(0, gesture.details.scroll_x()); |
| 775 EXPECT_EQ(scroll_delta, gesture.details.scroll_y()); | 775 EXPECT_EQ(scroll_delta, gesture.details.scroll_y()); |
| 776 } | 776 } |
| 777 | 777 |
| 778 // Verify that movement with the touch slop region does not generate a scroll, | |
|
tdresser
2014/04/09 14:00:01
with -> within
jdduke (slow)
2014/04/10 22:04:53
Done.
| |
| 779 // and that the slop region is correct even when using fractional coordinates. | |
| 780 TEST_F(GestureProviderTest, NoScrollWithinTouchSlop) { | |
| 781 const float touch_slop = GetTouchSlop(); | |
| 782 const float scale_factor = 2.5f; | |
| 783 const int touch_slop_pixels = static_cast<int>(scale_factor * touch_slop); | |
| 784 | |
| 785 base::TimeTicks event_time = base::TimeTicks::Now(); | |
| 786 | |
| 787 MockMotionEvent event = | |
| 788 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | |
| 789 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 790 | |
| 791 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, | |
| 792 MotionEvent::ACTION_MOVE, | |
| 793 kFakeCoordX + touch_slop_pixels / scale_factor, | |
| 794 kFakeCoordY); | |
| 795 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 796 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | |
| 797 | |
| 798 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, | |
| 799 MotionEvent::ACTION_MOVE, | |
| 800 kFakeCoordX, | |
| 801 kFakeCoordY + touch_slop_pixels / scale_factor); | |
| 802 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 803 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | |
| 804 | |
| 805 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, | |
| 806 MotionEvent::ACTION_MOVE, | |
| 807 kFakeCoordX - touch_slop_pixels / scale_factor, | |
| 808 kFakeCoordY); | |
| 809 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 810 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | |
| 811 | |
| 812 event = ObtainMotionEvent(event_time + kOneMicrosecond * 2, | |
| 813 MotionEvent::ACTION_MOVE, | |
| 814 kFakeCoordX, | |
| 815 kFakeCoordY - touch_slop_pixels / scale_factor); | |
| 816 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 817 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | |
| 818 | |
| 819 event = | |
| 820 ObtainMotionEvent(event_time + kOneMicrosecond * 2, | |
| 821 MotionEvent::ACTION_MOVE, | |
| 822 kFakeCoordX, | |
| 823 kFakeCoordY + (touch_slop_pixels + 1.f) / scale_factor); | |
| 824 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | |
| 825 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | |
| 826 } | |
| 827 | |
| 778 TEST_F(GestureProviderTest, NoDoubleTapWhenExplicitlyDisabled) { | 828 TEST_F(GestureProviderTest, NoDoubleTapWhenExplicitlyDisabled) { |
| 779 gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false); | 829 gesture_provider_->SetDoubleTapSupportForPlatformEnabled(false); |
| 780 | 830 |
| 781 base::TimeTicks event_time = base::TimeTicks::Now(); | 831 base::TimeTicks event_time = base::TimeTicks::Now(); |
| 782 MockMotionEvent event = ObtainMotionEvent( | 832 MockMotionEvent event = ObtainMotionEvent( |
| 783 event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); | 833 event_time, MotionEvent::ACTION_DOWN, kFakeCoordX, kFakeCoordY); |
| 784 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 834 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 785 EXPECT_EQ(1U, GetReceivedGestureCount()); | 835 EXPECT_EQ(1U, GetReceivedGestureCount()); |
| 786 EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); | 836 EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); |
| 787 | 837 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 988 MotionEvent::ACTION_UP, | 1038 MotionEvent::ACTION_UP, |
| 989 kFakeCoordX, | 1039 kFakeCoordX, |
| 990 kFakeCoordY + 200); | 1040 kFakeCoordY + 200); |
| 991 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1041 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 992 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_PINCH_END)); | 1042 EXPECT_FALSE(HasReceivedGesture(ET_GESTURE_PINCH_END)); |
| 993 } | 1043 } |
| 994 | 1044 |
| 995 // Verify that pinch zoom sends the proper event sequence. | 1045 // Verify that pinch zoom sends the proper event sequence. |
| 996 TEST_F(GestureProviderTest, PinchZoom) { | 1046 TEST_F(GestureProviderTest, PinchZoom) { |
| 997 base::TimeTicks event_time = base::TimeTicks::Now(); | 1047 base::TimeTicks event_time = base::TimeTicks::Now(); |
| 998 const int scaled_touch_slop = GetTouchSlop(); | 1048 const float touch_slop = GetTouchSlop(); |
| 999 int motion_event_id = 0; | 1049 int motion_event_id = 0; |
| 1000 | 1050 |
| 1001 gesture_provider_->SetMultiTouchSupportEnabled(true); | 1051 gesture_provider_->SetMultiTouchSupportEnabled(true); |
| 1002 | 1052 |
| 1003 int secondary_coord_x = kFakeCoordX + 20 * scaled_touch_slop; | 1053 int secondary_coord_x = kFakeCoordX + 20 * touch_slop; |
| 1004 int secondary_coord_y = kFakeCoordY + 20 * scaled_touch_slop; | 1054 int secondary_coord_y = kFakeCoordY + 20 * touch_slop; |
| 1005 | 1055 |
| 1006 MockMotionEvent event = | 1056 MockMotionEvent event = |
| 1007 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); | 1057 ObtainMotionEvent(event_time, MotionEvent::ACTION_DOWN); |
| 1008 event.SetId(++motion_event_id); | 1058 event.SetId(++motion_event_id); |
| 1009 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1059 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 1010 EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); | 1060 EXPECT_EQ(ET_GESTURE_TAP_DOWN, GetMostRecentGestureEventType()); |
| 1011 | 1061 |
| 1012 event = ObtainMotionEvent(event_time, | 1062 event = ObtainMotionEvent(event_time, |
| 1013 MotionEvent::ACTION_POINTER_DOWN, | 1063 MotionEvent::ACTION_POINTER_DOWN, |
| 1014 kFakeCoordX, | 1064 kFakeCoordX, |
| 1015 kFakeCoordY, | 1065 kFakeCoordY, |
| 1016 secondary_coord_x, | 1066 secondary_coord_x, |
| 1017 secondary_coord_y); | 1067 secondary_coord_y); |
| 1018 event.SetId(++motion_event_id); | 1068 event.SetId(++motion_event_id); |
| 1019 | 1069 |
| 1020 gesture_provider_->OnTouchEvent(event); | 1070 gesture_provider_->OnTouchEvent(event); |
| 1021 EXPECT_EQ(1U, GetReceivedGestureCount()); | 1071 EXPECT_EQ(1U, GetReceivedGestureCount()); |
| 1022 | 1072 |
| 1023 secondary_coord_x += 5 * scaled_touch_slop; | 1073 secondary_coord_x += 5 * touch_slop; |
| 1024 secondary_coord_y += 5 * scaled_touch_slop; | 1074 secondary_coord_y += 5 * touch_slop; |
| 1025 event = ObtainMotionEvent(event_time, | 1075 event = ObtainMotionEvent(event_time, |
| 1026 MotionEvent::ACTION_MOVE, | 1076 MotionEvent::ACTION_MOVE, |
| 1027 kFakeCoordX, | 1077 kFakeCoordX, |
| 1028 kFakeCoordY, | 1078 kFakeCoordY, |
| 1029 secondary_coord_x, | 1079 secondary_coord_x, |
| 1030 secondary_coord_y); | 1080 secondary_coord_y); |
| 1031 event.SetId(++motion_event_id); | 1081 event.SetId(++motion_event_id); |
| 1032 | 1082 |
| 1033 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1083 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 1034 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); | 1084 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); |
| 1035 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_PINCH_BEGIN)); | 1085 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_PINCH_BEGIN)); |
| 1036 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); | 1086 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_BEGIN)); |
| 1037 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_UPDATE)); | 1087 EXPECT_TRUE(HasReceivedGesture(ET_GESTURE_SCROLL_UPDATE)); |
| 1038 | 1088 |
| 1039 secondary_coord_x += 2 * scaled_touch_slop; | 1089 secondary_coord_x += 2 * touch_slop; |
| 1040 secondary_coord_y += 2 * scaled_touch_slop; | 1090 secondary_coord_y += 2 * touch_slop; |
| 1041 event = ObtainMotionEvent(event_time, | 1091 event = ObtainMotionEvent(event_time, |
| 1042 MotionEvent::ACTION_MOVE, | 1092 MotionEvent::ACTION_MOVE, |
| 1043 kFakeCoordX, | 1093 kFakeCoordX, |
| 1044 kFakeCoordY, | 1094 kFakeCoordY, |
| 1045 secondary_coord_x, | 1095 secondary_coord_x, |
| 1046 secondary_coord_y); | 1096 secondary_coord_y); |
| 1047 event.SetId(++motion_event_id); | 1097 event.SetId(++motion_event_id); |
| 1048 | 1098 |
| 1049 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1099 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 1050 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); | 1100 EXPECT_EQ(motion_event_id, GetMostRecentGestureEvent().motion_event_id); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1186 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL); | 1236 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL); |
| 1187 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1237 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 1188 EXPECT_EQ(ET_GESTURE_TAP_CANCEL, GetReceivedGesture(12).type); | 1238 EXPECT_EQ(ET_GESTURE_TAP_CANCEL, GetReceivedGesture(12).type); |
| 1189 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType()); | 1239 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType()); |
| 1190 EXPECT_EQ(14U, GetReceivedGestureCount()); | 1240 EXPECT_EQ(14U, GetReceivedGestureCount()); |
| 1191 | 1241 |
| 1192 | 1242 |
| 1193 } | 1243 } |
| 1194 | 1244 |
| 1195 } // namespace ui | 1245 } // namespace ui |
| OLD | NEW |