• Stephen Nusko's avatar
    De-flake & re-enable LayerTreeHostCopyRequestTestLayerDestroyed tests · 0c61f40a
    Stephen Nusko authored
    
    After http://crrev/c/2256225 we had two classes of flakes.
    1) The impl_destoryed_ CopyOutputResult would be non empty.
    2) The callback_count_ would be incorrect.
    
    The cause of 1) was in the change that introduced the flake we called
    SetViewportRectAndScale() after RunUntilIdle(), but
    SetViewportRectAndScale() was what prevented the CopyOutputResult
    returned to the impl callback from being non-empty. So if we
    RunUntilIdle() fast enough we would still prevent the drawing and the
    test would pass. So the fix is to immediately call
    SetViewportRectAndScale() after destroying the main to ensure its
    always fast enough.
    
    The cause of 2) was that RunUntilIdle() runs JUST the currently posted
    tasks, so there was a race between RunUntilIdle() being called and
    during the deconstruction of the layer PostTasking the callback. The
    fix is to only wait for the main callback in frame 3 so we can verify
    that it will happen before we destroy the impl layer. And wait for the
    impl at the end of the test.
    
    Bug: 1096962
    Change-Id: Iad066a2316f2e4df3bdf53379c87a4697d6da8bb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2294981Reviewed-by: default avatarWez <wez@chromium.org>
    Reviewed-by: default avatarkylechar <kylechar@chromium.org>
    Commit-Queue: Stephen Nusko <nuskos@chromium.org>
    Auto-Submit: Stephen Nusko <nuskos@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#790371}
    0c61f40a
layer_tree_host_unittest_copyrequest.cc 48.8 KB