Fix flaky bugs introduced by AverageLagTrackingManager
After commit crrev.com/917ce177 introduced the AverageLagTrackingManager some cc_unittests started failing. These test tested scenarios where frames were Drawn but didn't receive a PresentationFeedback on LayerTreeHostImpl. They were failing due to a DCHECK at AverageLagTrackingManager that checked the amount of pending frames without feedback before destruction. These frames never received a PresentationFeedback because LayerTreeFrameSink was purposefully losing its context (LayerTreeFrameSink::OnContextLost). This prevents DisplayScheduler to post the tasks that will ultimately call LayerTreeHostImpl::DidPresentCompositorFrame. In this CL the list in AverageLagTrackingManager is cleaned whenever LayerTreeFrameSink loses its context, as it is a sign that the current pending frames will never receive a presentation feedback. Also, frames that don't have relevant latency_info aren't added to the list anymore as this was one of the reasons why the tests where flaky too. Bug: 1103289, 1104841, 1106020, 1104202 Change-Id: I9b74ac22adb6db6af7c8e727304dc2e0b02e8899 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2303363Reviewed-by:Xida Chen <xidachen@chromium.org> Reviewed-by:
Robert Flack <flackr@chromium.org> Commit-Queue: João Victor Almeida de Aguiar <joalmei@microsoft.com> Cr-Commit-Position: refs/heads/master@{#791413}
Showing
Please register or sign in to comment