Commit 7f28761d authored by haozhe's avatar haozhe Committed by Commit Bot

Fix Flaky Composite Order test

This patch fixes the flakiness in getting running-animation order by
making sure the animation is running before we make a measurement.

This test passed all 500 repeated run.

Bug: 1060216
Change-Id: I8b271e1e0d31dac0203aa3a7bb3359f7f1d1eec6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2099474Reviewed-by: default avatarKevin Ellis <kevers@chromium.org>
Commit-Queue: Hao Sheng <haozhes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749528}
parent 8847f636
...@@ -42,9 +42,9 @@ promise_test(async t => { ...@@ -42,9 +42,9 @@ promise_test(async t => {
const animA = div.animate({margin: ["100px","100px"]}, 100000); const animA = div.animate({margin: ["100px","100px"]}, 100000);
assert_equals(getComputedStyle(div).marginLeft, '100px'); assert_equals(getComputedStyle(div).marginLeft, '100px');
div.style.animation = 'margin50 100s'; div.style.animation = 'margin50 100s';
assert_equals(getComputedStyle(div).marginLeft, '50px');
// Wait for animation starts // Wait for animation starts
await waitForAnimationFrames(2); await animA.ready;
await waitForAnimationFrames(1);
assert_equals(getComputedStyle(div).marginLeft, '100px', assert_equals(getComputedStyle(div).marginLeft, '100px',
"A higher-priority animation is not overriden by a more recent" "A higher-priority animation is not overriden by a more recent"
+ "one."); + "one.");
......
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