зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1256341
- Add a gtest to catch scenarios where a tap timeout is interrupted by a non-touch block. r=botond
MozReview-Commit-ID: 5kyb6VOxWU1
This commit is contained in:
Родитель
4317d4d96b
Коммит
e500e5d2b9
|
@ -605,6 +605,25 @@ TEST_F(APZCGestureDetectorTester, LongPressInterruptedByWheel) {
|
|||
Wheel(apzc, ScreenIntPoint(10, 10), ScreenPoint(0, -10), mcc->Time(), &wheelBlockId);
|
||||
EXPECT_NE(touchBlockId, wheelBlockId);
|
||||
mcc->AdvanceByMillis(1000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
TEST_F(APZCGestureDetectorTester, TapTimeoutInterruptedByWheel) {
|
||||
// In this test, even though the wheel block comes right after the tap, the
|
||||
// tap should still be dispatched because it completes fully before the wheel
|
||||
// block arrived.
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
|
||||
// We make the APZC zoomable so the gesture detector needs to wait to
|
||||
// distinguish between tap and double-tap. During that timeout is when we
|
||||
// insert the wheel event.
|
||||
MakeApzcZoomable();
|
||||
|
||||
uint64_t touchBlockId = 0;
|
||||
uint64_t wheelBlockId = 0;
|
||||
Tap(apzc, ScreenIntPoint(10, 10), mcc, TimeDuration::FromMilliseconds(100),
|
||||
nullptr, &touchBlockId);
|
||||
mcc->AdvanceByMillis(10);
|
||||
Wheel(apzc, ScreenIntPoint(10, 10), ScreenPoint(0, -10), mcc->Time(), &wheelBlockId);
|
||||
EXPECT_NE(touchBlockId, wheelBlockId);
|
||||
while (mcc->RunThroughDelayedTasks());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче