-
Jérôme Lebel authored
Adding completion UUID, to make sure EG tear down waits for completion from -[SceneController dismissModalDialogsWithCompletion:dismissOmnibox:] Some flakiness in the tests shows that |drainUntilIdleWithTimeout:| is not enough to make sure all views are fully dismissed before |removeAnyOpenMenusAndInfoBars| returns. Explanation of the flakiness: The test failure is related to: DCHECK(!self.tabSwitcherIsActive) [1], during the teardown. This DCHECK is in |completionWithBVC| completion block. This block is only used by |dismissModalDialogsWithCompletion:dismissOmnibox:| when the tab switcher is not opened [2]. So the only way to reproduce this failure, is to open the tab switcher while the views are being dismissed. During the tear down, |removeAnyOpenMenusAndInfoBars| calls |dismissModalDialogsWithCompletion:dismissOmnibox:|, and then |closeAllTabs| is called, which opens the tab switcher. This is why I suspect |[ChromeEarlGreyUI waitForToolbarVisible:YES]| is needed in +[ChromeTestCase removeAnyOpenMenusAndInfoBars]. [1] https://source.chromium.org/chromium/chromium/src/+/master:ios/chrome/browser/ui/main/scene_controller.mm;l=1940 [2] https://source.chromium.org/chromium/chromium/src/+/master:ios/chrome/browser/ui/main/scene_controller.mm;l=1960 Fixed: 1143204, 1146459 Change-Id: I152850dbe5844c96ed64919a3a791f44b94f6be7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612844 Commit-Queue: Jérôme Lebel <jlebel@chromium.org> Reviewed-by:
Eugene But <eugenebut@chromium.org> Cr-Commit-Position: refs/heads/master@{#840965}
1a21f92a