Skip to content

Commit

Permalink
Bug 1719855 - Fix DoLongPressPreventDefaultTest to scroll down the co…
Browse files Browse the repository at this point in the history
…ntent by touch events. r=botond

Originally the test tried to scroll up, thus the content didn't scroll at all.

Now with scrolling down touch events, the content scrolls down even if the
long-tap event was preventDefaulted.

Depends on D176480

Differential Revision: https://phabricator.services.mozilla.com/D176481
  • Loading branch information
hiikezoe committed Jun 22, 2023
1 parent 5820e0d commit 95b63ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gfx/layers/apz/test/gtest/TestGestureDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
// an APZC even if the long-tap event was preventDefaulted.
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);

int touchX = 10, touchStartY = 10, touchEndY = 50;
int touchX = 10, touchStartY = 50, touchEndY = 10;

APZEventResult result =
TouchDown(apzc, ScreenIntPoint(touchX, touchStartY), mcc->Time());
Expand Down Expand Up @@ -547,8 +547,8 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
AsyncTransform viewTransformOut;
apzc->SampleContentTransformForFrame(&viewTransformOut, pointOut);

EXPECT_EQ(ParentLayerPoint(), pointOut);
EXPECT_EQ(AsyncTransform(), viewTransformOut);
EXPECT_GT(pointOut.y, 0);
EXPECT_LT(viewTransformOut.mTranslation.y, 0);

apzc->AssertStateIsReset();
}
Expand Down

0 comments on commit 95b63ae

Please sign in to comment.