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

Unified Diff: ui/events/gesture_detection/gesture_provider_unittest.cc

Issue 178193022: [Android] Always insert a TouchCancel if window or tab focus is lost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
Index: ui/events/gesture_detection/gesture_provider_unittest.cc
diff --git a/ui/events/gesture_detection/gesture_provider_unittest.cc b/ui/events/gesture_detection/gesture_provider_unittest.cc
index 9cede09e157420878bc47184c4b38ebb38727aba..15af02f1d1998e6ce4a3c491440b6947205fc1bc 100644
--- a/ui/events/gesture_detection/gesture_provider_unittest.cc
+++ b/ui/events/gesture_detection/gesture_provider_unittest.cc
@@ -301,7 +301,7 @@ TEST_F(GestureProviderTest, TapCancelledWhenWindowFocusLost) {
EXPECT_EQ(GESTURE_LONG_PRESS, GetMostRecentGestureEventType());
// The long press triggers window focus loss by opening a context menu
- gesture_provider_->CancelActiveTouchSequence();
+ EXPECT_TRUE(gesture_provider_->CancelActiveTouchSequence());
EXPECT_EQ(GESTURE_TAP_CANCEL, GetMostRecentGestureEventType());
}
@@ -970,7 +970,7 @@ TEST_F(GestureProviderTest, GesturesCancelledAfterLongPressCausesLostFocus) {
Wait(long_press_timeout);
EXPECT_EQ(GESTURE_LONG_PRESS, GetMostRecentGestureEventType());
- gesture_provider_->CancelActiveTouchSequence();
+ EXPECT_TRUE(gesture_provider_->CancelActiveTouchSequence());
EXPECT_EQ(GESTURE_TAP_CANCEL, GetMostRecentGestureEventType());
event = ObtainMotionEvent(event_time + long_press_timeout,
@@ -984,7 +984,7 @@ TEST_F(GestureProviderTest, GesturesCancelledAfterLongPressCausesLostFocus) {
TEST_F(GestureProviderTest, CancelActiveTouchSequence) {
base::TimeTicks event_time = base::TimeTicks::Now();
- gesture_provider_->CancelActiveTouchSequence();
+ EXPECT_FALSE(gesture_provider_->CancelActiveTouchSequence());
EXPECT_EQ(0U, GetReceivedGestureCount());
MockMotionEvent event =
@@ -992,7 +992,7 @@ TEST_F(GestureProviderTest, CancelActiveTouchSequence) {
EXPECT_TRUE(gesture_provider_->OnTouchEvent(event));
EXPECT_EQ(GESTURE_TAP_DOWN, GetMostRecentGestureEventType());
- gesture_provider_->CancelActiveTouchSequence();
+ ASSERT_TRUE(gesture_provider_->CancelActiveTouchSequence());
EXPECT_EQ(GESTURE_TAP_CANCEL, GetMostRecentGestureEventType());
// Subsequent MotionEvent's are dropped until ACTION_DOWN.

Powered by Google App Engine
This is Rietveld 408576698