Fix presentation callback in LayerTreeHostPresentationDuringAnimation
`LayerTreeHostPresentationDuringAnimation` uses presentation time
callbacks registered using
`cc::LayerTreeHost::RequestPresentationTimeForNextFrame()` to determine
when presentation is completed. However, these callbacks are run even if
the presentation fails. This CL updates the test to use presentation
time callbacks registered using the newly introduced function
`cc::LayerTreeHost::RequestSuccessfulPresentationTimeForNextFrame()`
instead, which are run after a successful presentation.
Bug: 1378612
Change-Id: I8fd4636434d4fd812a4cd268fa9eb32800c21d6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4000162
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1069888}
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index e8db591a..d4f459f8 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1043,9 +1043,10 @@
if (const_cast<const LayerTreeHost*>(layer_tree_host())
->pending_commit_state()
->source_frame_number == 2) {
- layer_tree_host()->RequestPresentationTimeForNextFrame(base::BindOnce(
- &LayerTreeHostPresentationDuringAnimation::OnPresentation,
- base::Unretained(this)));
+ layer_tree_host()->RequestSuccessfulPresentationTimeForNextFrame(
+ base::BindOnce(
+ &LayerTreeHostPresentationDuringAnimation::OnPresentation,
+ base::Unretained(this)));
}
}
@@ -1079,7 +1080,7 @@
}
private:
- void OnPresentation(const gfx::PresentationFeedback& feedback) { EndTest(); }
+ void OnPresentation(base::TimeTicks presentation_timestamp) { EndTest(); }
FakeContentLayerClient client_;
scoped_refptr<FakePictureLayer> scroll_layer_;