Skip to content

Add other types of platform view tests to android_hardware_smoke_test#188244

Merged
auto-submit[bot] merged 11 commits into
flutter:masterfrom
andywolff:apktest4
Jun 24, 2026
Merged

Add other types of platform view tests to android_hardware_smoke_test#188244
auto-submit[bot] merged 11 commits into
flutter:masterfrom
andywolff:apktest4

Conversation

@andywolff

Copy link
Copy Markdown
Contributor

Expand test coverage to address more of #182123

This adds tests to cover the three types of platform views described in https://docs.flutter.dev/platform-integration/android/platform-views

For HCPP, we skip the test if we determine HCPP is not supported in the current run.

Pre-launch Checklist

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 19, 2026
@andywolff

Copy link
Copy Markdown
Contributor Author

Updated goldens look like this:

platformViewHybridCompositionPlusPlusTest (vulkan only)
platformViewHybridCompositionPlusPlusTest vulkan

platformViewHybridCompositionTest
platformViewHybridCompositionTest vulkan

platformViewTextureLayerTest
platformViewTextureLayerTest vulkan

@andywolff

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 the Android hardware smoke test suite to support and test three platform view composition modes: Texture Layer Hybrid Composition (TLHC), legacy Hybrid Composition (HC), and Hybrid Composition++ (HCPP), including skip logic for devices without HCPP support. The review feedback points out an incorrect platform views channel name used in the mock setup ('flutter/platform_views_2' instead of 'flutter/platform_views') and suggests refactoring duplicated 'onCreated' callback logic across the platform view test cases.

Comment thread dev/integration_tests/android_hardware_smoke_test/lib/main.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 22, 2026
@andywolff
andywolff marked this pull request as ready for review June 22, 2026 21:21
@andywolff
andywolff requested a review from gaaclarke June 22, 2026 21:21

@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 the Android hardware smoke test to support and test multiple platform view composition modes: Texture Layer Hybrid Composition (TLHC), legacy Hybrid Composition (HC), and Hybrid Composition++ (HCPP). It introduces a PlatformViewMode enum, updates AndroidPlatformView to initialize views using the corresponding mode, and adds logic to skip HCPP tests if the device does not support it. Feedback on the changes suggests correcting the mocked platform views method channel name in widget_test.dart from 'flutter/platform_views_2' to 'flutter/platform_views' to ensure the HCPP support check is mocked correctly, and removing a redundant local variable goldenName in goldens.dart.

Comment thread dev/integration_tests/android_hardware_smoke_test/lib/goldens.dart Outdated
- add comment about why `platform_views_2` is used
- remove reduntant variable
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 22, 2026
@Piinks Piinks added the engine flutter/engine related. See also e: labels. label Jun 22, 2026

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a few minor nits

find.byType(AndroidPlatformView),
);
final PlatformViewMode expectedMode = switch (testName) {
'platformViewTextureLayerTest' => PlatformViewMode.textureLayer,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

worth pulling out these constants

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did a pass on the whole directory to pull out all constants in both dart and kotlin

Comment on lines +18 to +22
const String platformViewTextureLayerTestName = 'platformViewTextureLayerTest';
const String platformViewHybridCompositionTestName =
'platformViewHybridCompositionTest';
const String platformViewHybridCompositionPlusPlusTestName =
'platformViewHybridCompositionPlusPlusTest';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these can have internal linkage (_platformViewTextureLayerTestName)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed redundant constants

@gaaclarke gaaclarke added the CICD Run CI/CD label Jun 22, 2026
@github-actions github-actions Bot added CICD Run CI/CD and removed CICD Run CI/CD engine flutter/engine related. See also e: labels. labels Jun 23, 2026
gaaclarke
gaaclarke previously approved these changes Jun 23, 2026

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks andy, lgtm!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be nice if we could generate these. I know that is a bit of a refactor, something to put on the back-burner.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can generate them fairly simply. I considered doing that here but it felt too far away from the purpose of this PR and maybe not worth the added complexity. I'll file a low priority sub-issue to follow up

@andywolff andywolff added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2026
@auto-submit

auto-submit Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 23, 2026
@andywolff

Copy link
Copy Markdown
Contributor Author

Whoops, looks like the constants commit contained a new a ktlint violation. Fixed. Sorry, could you please re-approve?

@andywolff
andywolff requested a review from gaaclarke June 23, 2026 20:50
@andywolff andywolff added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2026
@auto-submit

auto-submit Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

@andywolff andywolff added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2026
@andywolff

andywolff commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

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

Windows framework_tests_misc flaked, passing on retry

@auto-submit
auto-submit Bot added this pull request to the merge queue Jun 23, 2026
Merged via the queue into flutter:master with commit 7754312 Jun 24, 2026
30 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 24, 2026
@andywolff
andywolff deleted the apktest4 branch June 25, 2026 20:13
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
…flutter#188244)

Expand test coverage to address more of
flutter#182123

This adds tests to cover the three types of platform views described in
https://docs.flutter.dev/platform-integration/android/platform-views

For HCPP, we skip the test if we determine HCPP is not supported in the
current run.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants