test(android): wait on the InputMethod window before comparing keyboard pixels

Merged
TH
14h ago
+281-5

Summary

The Android smoke smoke:keyboard-ime scenario flaked with keyboard dismissal should change emulator pixels. The scenario already asserted keyboard status visible before the first capture and keyboard dismiss hidden before the second, so "keyboard never shown" is ruled out. Both signals come from mInputShown, which flips when the show or hide request is accepted. It does not flip when the keyboard is drawn or removed. On the slow CI emulator both captures can therefore show the same pixels.

The scenario now also waits (bounded, 10 s) on the InputMethod window from dumpsys window windows: drawn (isReadyForDisplay()=true, mDrawState=HAS_DRAWN) before the first capture, gone before the second. A keyboard that never drew fails with "reported visible but its InputMethod window never drew". The pixel comparison stays, and nothing is loosened.

5 files, test-only (live-ime-window.ts plus a unit test for its parser, createAdbRead exported, vitest include entry). Fixes #4264

Validation

  • pnpm check:affected --run --head dce8c3224aced5e92283ef017408ec5ddce390bf: passed, exactCommit=true, receipt run-lB0F8K.
  • Live, emulator-5556 (API 35, release fixture APK pulled from the device, no session held it): smoke:keyboard-ime passed 10/10. Negative run with the window matcher broken failed with the message above.
  • The flake itself did not reproduce locally, so only CI's Android smoke on this head can confirm the fix. The parser unit test had no base to fail against, because the module is new.
  • No independent reviewer was available. I re-read the diff cold.

šŸ¤– Generated with Claude Code


Autofix with [code]smith
Open in [code]smith Ā· Need help on this PR? Tag @codesmith-bot with what you need.