Skip to content

Add other types of platform view tests to android_hardware_smoke_test#188244

Draft
andywolff wants to merge 1 commit into
flutter:masterfrom
andywolff:apktest4
Draft

Add other types of platform view tests to android_hardware_smoke_test#188244
andywolff wants to merge 1 commit 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.


// Mock the built-in system platform views channel to allow mocking HCPP support checks
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
const MethodChannel('flutter/platform_views_2'),

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.

high

The platform views channel name in Flutter is 'flutter/platform_views', not 'flutter/platform_views_2'. Mocking 'flutter/platform_views_2' will not intercept the calls made by HybridAndroidViewController.checkIfSupported(), which will cause the HCPP success test to fail or skip incorrectly.

Suggested change
const MethodChannel('flutter/platform_views_2'),
const MethodChannel('flutter/platform_views'),

Comment on lines +199 to +216
'platformViewTextureLayerTest' => AndroidPlatformView(
mode: PlatformViewMode.textureLayer,
onCreated: () {
if (_platformViewCreatedCompleter?.isCompleted == false) {
_platformViewCreatedCompleter?.complete();
}
},
),
'platformViewHybridCompositionTest' => AndroidPlatformView(
mode: PlatformViewMode.hybridComposition,
onCreated: () {
if (_platformViewCreatedCompleter?.isCompleted == false) {
_platformViewCreatedCompleter?.complete();
}
},
),
'platformViewHybridCompositionPlusPlusTest' => AndroidPlatformView(
mode: PlatformViewMode.hybridCompositionPlusPlus,

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.

medium

The onCreated callback logic is duplicated across all three platform view test cases. You can simplify this by defining a single local helper function onPlatformViewCreated inside the build method and reusing it for each AndroidPlatformView instance.

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.

1 participant