• Wez's avatar
    [test] Provide RunLoop::RunUntilConditionForTest() helper. · 212eeb76
    Wez authored
    Some tests need to run the message loop until a particular condition
    becomes true, but have no direct signal from the code under test to
    use to trigger the check & terminate the run.
    
    RunUntilConditionForTest() runs the loop and repeatedly calls a supplied
    callback until it returns true, or the Run()-timeout expires. The helper
    returns true if the condition was met before the timeout.
    
    Bug: 1021777, 976740
    Change-Id: I18f887431a68cb73cc77a445f3b915284b111cb4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033162
    Commit-Queue: Wez <wez@chromium.org>
    Auto-Submit: Wez <wez@chromium.org>
    Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#738222}
    212eeb76
run_loop.h 16.3 KB