зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1586496 - Add a gtest. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D51480 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d1c15f9836
Коммит
e8e4a8641f
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "APZCBasicTester.h"
|
#include "APZCBasicTester.h"
|
||||||
#include "APZTestCommon.h"
|
#include "APZTestCommon.h"
|
||||||
|
#include "mozilla/StaticPrefs_apz.h"
|
||||||
|
|
||||||
// Note: There are additional tests that test gesture detection behaviour
|
// Note: There are additional tests that test gesture detection behaviour
|
||||||
// with multiple APZCs in TestTreeManager.cpp.
|
// with multiple APZCs in TestTreeManager.cpp.
|
||||||
|
@ -215,6 +216,28 @@ TEST_F(APZCGestureDetectorTester, Pan_With_Tap) {
|
||||||
apzc->AssertStateIsReset();
|
apzc->AssertStateIsReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(APZCGestureDetectorTester, SecondTapIsFar_Bug1586496) {
|
||||||
|
SCOPED_GFX_PREF_BOOL("layout.css.touch_action.enabled", false);
|
||||||
|
|
||||||
|
// Test that we receive two single-tap events when two tap gestures are
|
||||||
|
// close in time but far in distance.
|
||||||
|
EXPECT_CALL(*mcc, HandleTap(TapType::eSingleTap, _, 0, apzc->GetGuid(), _))
|
||||||
|
.Times(2);
|
||||||
|
|
||||||
|
TimeDuration brief =
|
||||||
|
TimeDuration::FromMilliseconds(StaticPrefs::apz_max_tap_time() / 10);
|
||||||
|
|
||||||
|
ScreenIntPoint point(10, 10);
|
||||||
|
Tap(apzc, point, brief);
|
||||||
|
|
||||||
|
mcc->AdvanceBy(brief);
|
||||||
|
|
||||||
|
point.x += apzc->GetSecondTapTolerance() * 2;
|
||||||
|
point.y += apzc->GetSecondTapTolerance() * 2;
|
||||||
|
|
||||||
|
Tap(apzc, point, brief);
|
||||||
|
}
|
||||||
|
|
||||||
class APZCFlingStopTester : public APZCGestureDetectorTester {
|
class APZCFlingStopTester : public APZCGestureDetectorTester {
|
||||||
protected:
|
protected:
|
||||||
// Start a fling, and then tap while the fling is ongoing. When
|
// Start a fling, and then tap while the fling is ongoing. When
|
||||||
|
|
Загрузка…
Ссылка в новой задаче