Bug 1468804 - Remove APZCTesterBase::APZCPanNoFling. r=botond

MozReview-Commit-ID: BgEh7E4lDYF

--HG--
extra : rebase_source : f1c70516574db025f21aad3ea6b27abb0b040bc5
This commit is contained in:
Jeremy Lempereur 2018-06-24 18:13:03 +02:00
parent c6864ae376
commit f1b87018df
5 changed files with 31 additions and 32 deletions

View File

@ -211,6 +211,14 @@ public:
mcc = nullptr;
}
/**
* This function is not currently implemented.
* See bug 1468804 for more information.
**/
void CancelAnimation() {
EXPECT_TRUE(false);
}
protected:
AsyncPanZoomController* NewAPZCInstance(LayersId aLayersId,
GeckoContentController* aController) override;
@ -355,7 +363,8 @@ public:
* to pass in coordinates that are sufficient to overcome the touch-start
* tolerance *and* cause the desired amount of scrolling.
*/
ExactCoordinates = 0x2
ExactCoordinates = 0x2,
NoFling = 0x4
};
enum class PinchOptions {
@ -413,11 +422,6 @@ public:
nsTArray<uint32_t>* aAllowedTouchBehaviors,
uint64_t* aOutInputBlockId = nullptr);
void ApzcPanNoFling(const RefPtr<TestAsyncPanZoomController>& aApzc,
int aTouchStartY,
int aTouchEndY,
uint64_t* aOutInputBlockId = nullptr);
template<class InputReceiver>
void DoubleTap(const RefPtr<InputReceiver>& aTarget,
const ScreenIntPoint& aPoint,
@ -589,6 +593,10 @@ APZCTesterBase::Pan(const RefPtr<InputReceiver>& aTarget,
(*aOutEventStatuses)[3] = status;
}
if ((aOptions & PanOptions::NoFling)) {
aTarget->CancelAnimation();
}
// Don't increment the time here. Animations started on touch-up, such as
// flings, are affected by elapsed time, and we want to be able to sample
// them immediately after they start, without time having elapsed.
@ -630,15 +638,6 @@ APZCTesterBase::PanAndCheckStatus(const RefPtr<InputReceiver>& aTarget,
EXPECT_EQ(touchMoveStatus, statuses[2]);
}
void
APZCTesterBase::ApzcPanNoFling(const RefPtr<TestAsyncPanZoomController>& aApzc,
int aTouchStartY, int aTouchEndY,
uint64_t* aOutInputBlockId)
{
Pan(aApzc, aTouchStartY, aTouchEndY, PanOptions::None, nullptr, nullptr, aOutInputBlockId);
aApzc->CancelAnimation();
}
template<class InputReceiver>
void
APZCTesterBase::DoubleTap(const RefPtr<InputReceiver>& aTarget,

View File

@ -169,7 +169,7 @@ TEST_F(APZCBasicTester, FlingIntoOverscroll) {
SCOPED_GFX_PREF(APZFlingMinVelocityThreshold, float, 0.0f);
// Scroll down by 25 px. Don't fling for simplicity.
ApzcPanNoFling(apzc, 50, 25);
Pan(apzc, 50, 25, PanOptions::NoFling);
// Now scroll back up by 20px, this time flinging after.
// The fling should cover the remaining 5 px of room to scroll, then
@ -222,7 +222,7 @@ TEST_F(APZCBasicTester, PanningTransformNotifications) {
}
check.Call("Simple pan");
ApzcPanNoFling(apzc, 50, 25);
Pan(apzc, 50, 25, PanOptions::NoFling);
check.Call("Complex pan");
Pan(apzc, 25, 45);
apzc->AdvanceAnimationsUntilEnd();

View File

@ -235,10 +235,10 @@ TEST_F(APZEventRegionsTester, Obscuration) {
manager->UpdateHitTestingTree(LayersId{0}, root, false, LayersId{0}, 0);
TestAsyncPanZoomController* parent = ApzcOf(layers[1]);
RefPtr<TestAsyncPanZoomController> parent = ApzcOf(layers[1]);
TestAsyncPanZoomController* child = ApzcOf(layers[2]);
ApzcPanNoFling(parent, 75, 25);
Pan(parent, 75, 25, PanOptions::NoFling);
gfx::CompositorHitTestInfo result;
RefPtr<AsyncPanZoomController> hit = manager->GetTargetAPZC(ScreenPoint(50, 75), &result);

View File

@ -185,7 +185,7 @@ TEST_F(APZHitTestingTester, HitTesting2) {
// layers[2] has content from (20,60)-(100,100). no clipping as it's not a scrollable layer
// layers[3] has content from (20,60)-(180,140), clipped by composition bounds (20,60)-(100,100)
TestAsyncPanZoomController* apzcroot = ApzcOf(root);
RefPtr<TestAsyncPanZoomController> apzcroot = ApzcOf(root);
TestAsyncPanZoomController* apzc1 = ApzcOf(layers[1]);
TestAsyncPanZoomController* apzc3 = ApzcOf(layers[3]);
@ -238,7 +238,7 @@ TEST_F(APZHitTestingTester, HitTesting2) {
// This first pan will move the APZC by 50 pixels, and dispatch a paint request.
// Since this paint request is in the queue to Gecko, transformToGecko will
// take it into account.
ApzcPanNoFling(apzcroot, 100, 50);
Pan(apzcroot, 100, 50, PanOptions::NoFling);
// Hit where layers[3] used to be. It should now hit the root.
hit = GetTargetAPZC(ScreenPoint(75, 75));
@ -262,7 +262,7 @@ TEST_F(APZHitTestingTester, HitTesting2) {
// This second pan will move the APZC by another 50 pixels.
EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1);
ApzcPanNoFling(apzcroot, 100, 50);
Pan(apzcroot, 100, 50, PanOptions::NoFling);
// Hit where layers[3] used to be. It should now hit the root.
hit = GetTargetAPZC(ScreenPoint(75, 75));
@ -403,7 +403,7 @@ TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
CreateSimpleScrollingLayer();
ScopedLayerTreeRegistration registration(manager, LayersId{0}, root, mcc);
manager->UpdateHitTestingTree(LayersId{0}, root, false, LayersId{0}, 0);
TestAsyncPanZoomController* apzcroot = ApzcOf(root);
RefPtr<TestAsyncPanZoomController> apzcroot = ApzcOf(root);
// At this point, the following holds (all coordinates in screen pixels):
// layers[0] has content from (0,0)-(500,500), clipped by composition bounds (0,0)-(200,200)
@ -422,7 +422,7 @@ TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
}
// This first pan will move the APZC by 50 pixels, and dispatch a paint request.
ApzcPanNoFling(apzcroot, 100, 50);
Pan(apzcroot, 100, 50, PanOptions::NoFling);
// Verify that a touch start doesn't get untransformed
ScreenIntPoint touchPoint(50, 50);
@ -445,10 +445,10 @@ TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
// (Note that any outstanding repaint requests from the first half of this test
// don't impact this half because we advance the time by 1 second, which will trigger
// the max-wait-exceeded codepath in the paint throttler).
ApzcPanNoFling(apzcroot, 100, 50);
Pan(apzcroot, 100, 50, PanOptions::NoFling);
check.Call("post-second-fling");
ApzcPanNoFling(apzcroot, 100, 50);
Pan(apzcroot, 100, 50, PanOptions::NoFling);
// Ensure that a touch start again doesn't get untransformed by flushing
// a repaint
mti.mType = MultiTouchInput::MULTITOUCH_START;

View File

@ -164,7 +164,7 @@ TEST_F(APZScrollHandoffTester, DeferredInputEventProcessing) {
// Set up the APZC tree.
CreateScrollHandoffLayerTree1();
TestAsyncPanZoomController* childApzc = ApzcOf(layers[1]);
RefPtr<TestAsyncPanZoomController> childApzc = ApzcOf(layers[1]);
// Enable touch-listeners so that we can separate the queueing of input
// events from them being processed.
@ -172,7 +172,7 @@ TEST_F(APZScrollHandoffTester, DeferredInputEventProcessing) {
// Queue input events for a pan.
uint64_t blockId = 0;
ApzcPanNoFling(childApzc, 90, 30, &blockId);
Pan(childApzc, 90, 30, PanOptions::NoFling, nullptr, nullptr, &blockId);
// Allow the pan to be processed.
childApzc->ContentReceivedInputBlock(blockId, false);
@ -192,7 +192,7 @@ TEST_F(APZScrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
// Set up an initial APZC tree.
CreateScrollHandoffLayerTree1();
TestAsyncPanZoomController* childApzc = ApzcOf(layers[1]);
RefPtr<TestAsyncPanZoomController> childApzc = ApzcOf(layers[1]);
// Enable touch-listeners so that we can separate the queueing of input
// events from them being processed.
@ -200,7 +200,7 @@ TEST_F(APZScrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
// Queue input events for a pan.
uint64_t blockId = 0;
ApzcPanNoFling(childApzc, 90, 30, &blockId);
Pan(childApzc, 90, 30, PanOptions::NoFling, nullptr, nullptr, &blockId);
// Modify the APZC tree to insert a new APZC 'middle' into the handoff chain
// between the child and the root.
@ -211,7 +211,7 @@ TEST_F(APZScrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
// Queue input events for another pan.
uint64_t secondBlockId = 0;
ApzcPanNoFling(childApzc, 30, 90, &secondBlockId);
Pan(childApzc, 30, 90, PanOptions::NoFling, nullptr, nullptr, &secondBlockId);
// Allow the first pan to be processed.
childApzc->ContentReceivedInputBlock(blockId, false);