Reland "Reland "Introduce CriteriaHelper#pollUiThreadNested""
Introduce CriteriaHelper#pollUiThreadNested This change adds an assertion that pollUiThread is not called from the UI thread, which is equivalent to calling sleep(), and won't actually run any UI thread tasks. In the few cases where polling the UI Thread from the UI thread is necessary, I introduce CriteriaHelper#pollUiThreadNested, which nests the looper in order to continue running UI tasks. The reland introduces pollUiThreadForJUnit because some junit tests legitimately do need to sleep the UI thread to wait for events on other threads. Bug: 1115220 Change-Id: I09654521c0dab74f45a15b56b7876b4ee1871dd7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364085Reviewed-by:Yaron Friedman <yfriedman@chromium.org> Commit-Queue: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/master@{#800602}
Showing
Please register or sign in to comment