Skip to content

Reduce boilerplate in FlutterPlatformViewsTest.mm#184555

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
mahi-ma:reduce-boilerplate-FlutterPlatformViewsTest
Apr 10, 2026
Merged

Reduce boilerplate in FlutterPlatformViewsTest.mm#184555
auto-submit[bot] merged 2 commits into
flutter:masterfrom
mahi-ma:reduce-boilerplate-FlutterPlatformViewsTest

Conversation

@mahi-ma

@mahi-ma mahi-ma commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracts repeated view-hierarchy traversal (FlutterTouchInterceptingView lookup) and gesture recognizer search (ForwardingGestureRecognizer lookup) into two static helper functions: FindTouchInterceptingView and FindForwardingGestureRecognizer
  • Replaces 12 inline while-loop traversals and 7 inline for-loop gesture recognizer searches across the test file
  • Removes 6 unnecessary type casts since the variable is now properly typed as FlutterTouchInterceptingView*
  • Net reduction of ~68 lines with no changes to test logic or assertions

Fixes #184437

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide.
  • I listed at least one issue that this PR fixes in the description above.
  • I added a test for the change if applicable. (This is a test-only refactor — no new tests needed.)

@mahi-ma mahi-ma requested a review from a team as a code owner April 3, 2026 03:14
@google-cla

google-cla Bot commented Apr 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Apr 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors FlutterPlatformViewsTest.mm by extracting redundant logic for finding touch intercepting views and forwarding gesture recognizers into two new static helper functions: FindTouchInterceptingView and FindForwardingGestureRecognizer. The reviewer identified that the documentation for these functions should use triple-slash (///) comments to align with the Flutter Repository Style Guide's standards for private and static members.

@mahi-ma mahi-ma force-pushed the reduce-boilerplate-FlutterPlatformViewsTest branch from a27f316 to 13aeb8f Compare April 3, 2026 03:26
…r functions

Extract repeated view-hierarchy traversal and gesture recognizer lookup
patterns into two static helper functions: FindTouchInterceptingView and
FindForwardingGestureRecognizer. This replaces 12 copies of the while-loop
traversal and 7 copies of the for-loop gesture recognizer search, reducing
the file by ~68 lines while preserving all test logic.

Fixes flutter#184437
@mahi-ma mahi-ma force-pushed the reduce-boilerplate-FlutterPlatformViewsTest branch from 13aeb8f to ae621ee Compare April 3, 2026 03:29
@LouiseHsu LouiseHsu added the CICD Run CI/CD label Apr 6, 2026

@LouiseHsu LouiseHsu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks so much cleaner! LGTM.

@mahi-ma

mahi-ma commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Looks so much cleaner! LGTM.

Thanks @LouiseHsu for approving it, shall I merge it now?

@LouiseHsu

Copy link
Copy Markdown
Contributor

Looks so much cleaner! LGTM.

Thanks @LouiseHsu for approving it, shall I merge it now?

You won't be able to - you need to be a member of flutter-hackers to merge your own PRs. Usually you need at least two approving reviews before a PR can be merged. Someone else will take a look soon :)

@LouiseHsu LouiseHsu requested a review from hellohuanlin April 8, 2026 19:53
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 9, 2026
@jmagman jmagman added the CICD Run CI/CD label Apr 9, 2026
@LongCatIsLooong

Copy link
Copy Markdown
Contributor

/cc @hellohuanlin from ios triage

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 9, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 9, 2026
@auto-submit

auto-submit Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/184555, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 10, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 10, 2026
Merged via the queue into flutter:master with commit cad6073 Apr 10, 2026
203 of 204 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 10, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 11, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 12, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 13, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 13, 2026
flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
## Summary

- Extracts repeated view-hierarchy traversal
(`FlutterTouchInterceptingView` lookup) and gesture recognizer search
(`ForwardingGestureRecognizer` lookup) into two static helper functions:
`FindTouchInterceptingView` and `FindForwardingGestureRecognizer`
- Replaces 12 inline while-loop traversals and 7 inline for-loop gesture
recognizer searches across the test file
- Removes 6 unnecessary type casts since the variable is now properly
typed as `FlutterTouchInterceptingView*`
- Net reduction of ~68 lines with no changes to test logic or assertions

Fixes flutter#184437

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added a test for the change if applicable. _(This is a test-only
refactor — no new tests needed.)_

[Contributor Guide]:
https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md

Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11497)

flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Istiak-Ahmed78 pushed a commit to Istiak-Ahmed78/packages that referenced this pull request Jun 19, 2026
…r#11497)

flutter/flutter@bf18e39...2fa45e0

2026-04-13 sigurdm@google.com Test that the locked version of dependencies of sdk packages equal the lower bound (flutter/flutter#183395)
2026-04-13 engine-flutter-autoroll@skia.org Roll Skia from 8d35796258a2 to 55ddd6bb8be5 (1 revision) (flutter/flutter#184952)
2026-04-12 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from tEm4sdcM6twjxQ0w6... to K_2AkZL3Drs6cGE1q... (flutter/flutter#184930)
2026-04-12 engine-flutter-autoroll@skia.org Roll Dart SDK from 77324e51833a to ef28089d6533 (1 revision) (flutter/flutter#184929)
2026-04-12 engine-flutter-autoroll@skia.org Roll Skia from 6942f5774d65 to 8d35796258a2 (2 revisions) (flutter/flutter#184924)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 8fdbf58b58bd to 77324e51833a (1 revision) (flutter/flutter#184921)
2026-04-11 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from lZcRfPoCLnDttrf9P... to tEm4sdcM6twjxQ0w6... (flutter/flutter#184917)
2026-04-11 engine-flutter-autoroll@skia.org Roll Dart SDK from 7128b5b5142c to 8fdbf58b58bd (1 revision) (flutter/flutter#184906)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from 8cbf3db1a0db to 6942f5774d65 (1 revision) (flutter/flutter#184911)
2026-04-11 rmolivares@renzo-olivares.dev `SelectableRegion` can dismiss context menu with keyboard shortcuts (flutter/flutter#184788)
2026-04-11 engine-flutter-autoroll@skia.org Roll Skia from a8128c7adc49 to 8cbf3db1a0db (1 revision) (flutter/flutter#184904)
2026-04-10 engine-flutter-autoroll@skia.org Roll Dart SDK from e715805ddbd3 to 7128b5b5142c (3 revisions) (flutter/flutter#184896)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 7c8b85349a9a to a8128c7adc49 (2 revisions) (flutter/flutter#184899)
2026-04-10 mdebbar@google.com [web] Refactor LazyPath and separate immutable paths from path builders (flutter/flutter#177686)
2026-04-10 engine-flutter-autoroll@skia.org Roll Skia from 25b01e5f4ea0 to 7c8b85349a9a (13 revisions) (flutter/flutter#184887)
2026-04-10 mahimasharma0309@gmail.com Reduce boilerplate in FlutterPlatformViewsTest.mm (flutter/flutter#184555)
2026-04-10 matej.knopp@gmail.com [macOS] Add move timer runloop mode to common modes (flutter/flutter#182295)
2026-04-10 engine-flutter-autoroll@skia.org Roll Packages from 1aa892c to c2e3d1f (5 revisions) (flutter/flutter#184886)
2026-04-10 matej.knopp@gmail.com Win32: Prevent mouse leave on WM_SYSKEYUP. (flutter/flutter#184835)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlutterPlatformViewsTest.mm should reduce boilerplate code

5 participants