• Michael Thiessen's avatar
    Reland "Reland "Introduce CriteriaHelper#pollUiThreadNested"" · 7ab28be7
    Michael Thiessen authored
    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: default avatarYaron Friedman <yfriedman@chromium.org>
    Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#800602}
    7ab28be7
BUILD.gn 147 KB