Commit 0bf05253 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Add test for replacing a composited animation

CL 1715764 introduced a performance regression, where a replaced
animation would not be composited for the initial frame.  This was
caused by a bug in calculation of the pending state, which in turn
caused a replaced animation to be flagged as incompatible.  The bug was
fixed in CL 1728074. This patch introduced a test to ensure that the fix
does not regress.

Bug: 992408
Change-Id: Iab210ca9b525773ebb2c0a6f28d63f25c0b574e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2080445Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745970}
parent d35c63c5
......@@ -137,6 +137,10 @@ class AnimationAnimationTestNoCompositing : public RenderingTest {
SetBodyInnerHTML("<div id='target'></div>");
MakeCompositedAnimation();
}
void MakeCompositedAnimation() {
// Create a compositable animation; in this case opacity from 1 to 0.
Timing timing;
timing.iteration_duration = AnimationTimeDelta::FromSecondsD(30);
......@@ -1329,6 +1333,22 @@ TEST_F(AnimationAnimationTestCompositing, PreCommitRecordsHistograms) {
}
}
// crbug.com/990000.
TEST_F(AnimationAnimationTestCompositing, ReplaceCompositedAnimation) {
const std::string histogram_name =
"Blink.Animation.CompositedAnimationFailureReason";
// Start with a composited animation.
ResetWithCompositedAnimation();
ASSERT_TRUE(animation->HasActiveAnimationsOnCompositor());
// Replace the animation. The new animation should not be incompatible and
// therefore able to run on the compositor.
animation->cancel();
MakeCompositedAnimation();
ASSERT_TRUE(animation->HasActiveAnimationsOnCompositor());
}
TEST_F(AnimationAnimationTestCompositing, SetKeyframesCausesCompositorPending) {
ResetWithCompositedAnimation();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment