Fix dialog gets randomly closed in tests
When tests run in parrallel, the dialog get randomly closed with reason lost focus. For bubble dialog, when they get deactivate they will close themselves: https://cs.chromium.org/chromium/src/ui/views/bubble/bubble_dialog_delegate_view.cc?l=237&rcl=c32f919eb9638bd8b1030a460c016c6b75a1c286 There's also test trying to tackle the problem: https://cs.chromium.org/chromium/src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc?l=345&rcl=2e48cb8072cdcf0a4da0c3e04e196a100838ebcc This cl will fix it by block close the dialog temporarily. Why it wasn't an issue when pixel test not enabled? It's because there's no wait/async in ShowAndVerifyUi(). But with pixeltest, there are several async calls and wait for callback, which give the browser chance to close the dialog. Eg the async in snapshot: https://cs.chromium.org/chromium/src/ui/snapshot/snapshot_aura.cc?l=51&rcl=07fe9cc024d6c20514423412c9c3aead11d9767c When running in 36 launcher jobs, this issue contributes ~2% flakiness. I've also observed that in very rare cases, dialog can get closed with ESC pressed. But I didn't figure out which test mis-sending the ESC key press to the system. So the block close will block all reasons instead of lost focus only. Bug: 958242 Change-Id: I51037dd7070fc4c35195d0e07c408763906dcdd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1889949 Commit-Queue: Sven Zheng <svenzheng@chromium.org> Reviewed-by:Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#711110}
Showing
Please register or sign in to comment