[ios] Switches drainUntilIdle to use GREYWaitForAppToIdle() instead.

[GREYUIThreadExecutor drainUntilIdle] may cause deadlocks when invoked
from the main thread of the test process. Switching to a helper that
makes the call from a background thread may avoid these potential
deadlocks.

Change-Id: I9b8c67254e9e07b3b3ba2796efd8db952f3c30b2
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285630
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#787039}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 004a1dd1ba69f026d39ac3e3ab1f9a27f2436893
25 files changed