Skip to content

[integration_test] HitTest regression with setSurfaceSize #82557

@prefanatic

Description

@prefanatic

👋

We have a particular use case for integration_test where we use IntegrationTestWidgetsFlutterBinding.setSurfaceSize in order to simplify scrolling and include more content for the purpose of screenshot reviews. It seems that WidgetTester.tap was working before with setSurfaceSize, but now misses.

In Flutter 1.22.6, in combination with flutter/plugins/integration_test - this works well.
In Flutter 2.0.6 up to 2.3.0, using flutter/packages/integration_test - it appears to have regressed.

I have updated the test case Test Integration binding setSurfaceSize works for the two package variants:

The test case is equivalent across both, but separate to highlight the regression at some point post 1.22.6.

I've created a small project to help facilitate git bisect in discovering where this regression occurred. The project can be seen here. The following bisect parameters were used:

git bisect start HEAD 13860a7d23c564ec9ff38a44661d21160c3f7b1e
git bisect run dart ..\integration_test_bisect\tool\integration_test_bisect.dart

HEAD in this case refers to afb98ea

The bisect keyed into a48e143 as the source of this particular test failure. PR #64846.

I hope this isn't frowned upon, but @dkwingsmt & @goderbauer for pings.


The following indicates the breakpoint for Flutter 1.22.6, which shows an appropriate hit test transform in a scaled state:
flutter_1 22 6

The following indicates the breakpoint for Flutter 2.3.0-2.0.pre.206, which seems to show a double-transformed hit test result, for the same test case:
flutter_2 3 0

Removing the implementation for _LiveTestRenderView.hitTest allows the test to pass on mainline, but given the complexities, and that _LiveTestRenderView.hitTest is utilized for more than just integration_test, I'm not certain this is the correct approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: regressionIt was better in the past than it is nowf: integration_testThe flutter/packages/integration_test pluginfound in release: 2.0Found to occur in 2.0found in release: 2.3Found to occur in 2.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions