[android_hardware_smoke_test] Synchronize platform view compositing#189151
Conversation
Replace the hardcoded 3-frame wait in platform view tests with a native draw event listener to prevent intermittent black screenshot failures.
|
started staging runs Vulkan Shard ( Linux_android_emu_vulkan_stable android_hardware_smoke_vulkan_tests ): https://ci.chromium.org/b/8676815650908894593 OpenGL ES Shard ( Linux_android_emu android_hardware_smoke_opengles_tests ): https://ci.chromium.org/b/8676815638421172241 |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request modifies the Android hardware smoke test to synchronize platform view rendering. It introduces an ObservableTextView that triggers an onDraw method channel callback when painted, allowing the Dart side to await this callback and wait only 1 frame rather than a fixed 3 frames. Review feedback suggests using mapKeys for a more idiomatic Kotlin map transformation and storing the posted Runnable as a member variable to safely remove it on disposal, preventing potential race conditions.
There was a problem hiding this comment.
Code Review
This pull request updates the Android hardware smoke test to improve synchronization between native platform views and the Dart framework. It introduces an 'ObservableTextView' in Kotlin that overrides 'onDraw' to trigger a method channel callback, allowing the Dart app to wait for the native view to finish painting before proceeding. The 'goldens.dart' file was updated to use this callback for better timing, and the 'MainActivity' was modified to register the new view factory with this callback mechanism. No review comments were provided for this pull request.
gmackall
left a comment
There was a problem hiding this comment.
lgtm aside from removing onCreated from AndroidPlatformView if it is indeed unused now
| kPlatformViewTextureLayerTest => AndroidPlatformView( | ||
| kPlatformViewTextureLayerTest => const AndroidPlatformView( | ||
| mode: PlatformViewMode.textureLayer, | ||
| onCreated: onPlatformViewCreated, |
There was a problem hiding this comment.
I think this is all of the onCreated uses in AndroidPlatformView (inside dev/integration_tests/android_hardware_smoke_test/lib/platform_view.dart) right? Should we remove the parameter if it's unused now?
There was a problem hiding this comment.
whoops forgot to submit the comment before leaving review, this is what I was referring to
|
autosubmit label was removed for flutter/flutter/189151, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
I reran dashboard checks flakes and they passed, so I'm adding autosubmit label back |
flutter/flutter@f7b66f3...cf9e8af 2026-07-12 [email protected] Flip from deprecated strict analysis modes to lint rules (flutter/flutter#187692) 2026-07-12 [email protected] Roll Skia from 6ecffccd32d5 to 8bf65996caba (5 revisions) (flutter/flutter#189333) 2026-07-11 [email protected] Roll Fuchsia Linux SDK from czpzDg9ABY2oKLAOY... to vhIlDkWIy21IrlB9E... (flutter/flutter#189309) 2026-07-11 [email protected] iOS: clean up swiftc.py after migration to target triples (flutter/flutter#189240) 2026-07-10 [email protected] Increase number of 'Mac tool_integration_tests' subshards from 5 to 10 (flutter/flutter#189040) 2026-07-10 [email protected] Fix PopupWindowControllerLinux missing WindowControllerLinux implementation (flutter/flutter#189189) 2026-07-10 [email protected] [android_hardware_smoke_test] Synchronize platform view compositing (flutter/flutter#189151) 2026-07-10 [email protected] UberSDF thin roundrect handling (flutter/flutter#189224) 2026-07-10 [email protected] Roll Skia from ab3a7b98c94d to 6ecffccd32d5 (15 revisions) (flutter/flutter#189270) 2026-07-10 [email protected] [skwasm][canvaskit] Honor Paint.filterQuality in Canvas.drawAtlas (flutter/flutter#186108) 2026-07-10 [email protected] Android_hardware_smoke_test: Cache flutter engine when running vulkan backend instrumented tests (flutter/flutter#189026) 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 [email protected],[email protected] 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
Fixes #189079 - one in 100 runs failed with blank/black golden screenshots on the Vulkan backend for platform view tests in the
android_hardware_smoke_testintegration test suite.Previously, the driver tests (goldens.dart) hardcoded a 3 frame wait before screenshotting. In CI, native views occasionally did not paint that quickly, causing blank screenshot failures.
To resolve this, we replace the hardcoded wait with a native drawing synchronization mechanism: the Kotlin
TextViewsubclass overridesonDrawto notify Dart over Method Channels when it paints. I tried a tree-wideOnDrawListener, but it fired too early, so I went with this. Dart awaits this draw signal followed by 1 frame to ensure the compositor submits the frame before capturing coordinates.Verified on my local device by temporarily marking the native view as invisible for 3 seconds. Tests produced black screens before this change and correct results after this change.
Pre-launch Checklist
///).