• Sadrul Habib Chowdhury's avatar
    layout tests: Fix some flakes with --enable-display-compositor-pixel-dump · f889e443
    Sadrul Habib Chowdhury authored
    A number of layout tests requests a testRunner.capturePixelsAsyncThen().
    When not using the display-compositor for pixel-dumps, this triggers a
    complete composition (i.e. this triggers a commit, raster, frame
    submission, and processing in the display compositor). The tests that
    use the testRunner.capturePixelsAsyncThen(callback) API expects these
    steps to be completed before the callback is run. However, when using the
    display-compositor for pixel-dumps, it immediately triggers the callback
    without doing any of these steps. This caused a bunch of tests to fail,
    or become flaky, when --enable-display-compositor-pixel-dump became the
    default.
    
    This patch fixes the flakiness, by making sure the callback is run only
    after all the required steps have been performed. This is done by forcing
    a redraw, and requesting a presentation-timestamp from viz. This does not
    actually fix the readback itself, i.e. the pixels returned to the
    callback is still invalid. However, this does fix the timing of running
    the callback. That is sufficient to fix a number of the existing flaky
    tests.
    
    Bug: 891427
    Change-Id: Ic09db1c3a0a410b2d5687999d7144260df7ea272
    Reviewed-on: https://chromium-review.googlesource.com/c/1322364Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatardanakj <danakj@chromium.org>
    Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
    Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#607906}
    f889e443
test_runner.cc 88.9 KB