Add other types of platform view tests to android_hardware_smoke_test#188244
Add other types of platform view tests to android_hardware_smoke_test#188244andywolff wants to merge 1 commit into
Conversation
|
/gemini review |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
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.
| const MethodChannel('flutter/platform_views_2'), | |
| const MethodChannel('flutter/platform_views'), |
| '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, |



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
///).