Commit d3d67707 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Fix flaky play-state-initially-paused.html

virtual/threaded/animations/play-state-initially-paused.html was failing,
and had platform-specific (failure) expectations.

The test has been redesigned to not rely on precise sample timing.

BUG=392706

Change-Id: Iffb469427a9af700b111f1c654ae98e47a1aa304
Reviewed-on: https://chromium-review.googlesource.com/702180Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506915}
parent c412ab58
......@@ -1144,10 +1144,6 @@ crbug.com/528062 [ Win ] virtual/mojo-loading/http/tests/security/contentSecurit
crbug.com/528062 [ Win ] virtual/mojo-loading/http/tests/security/xssAuditor/cached-frame.html [ Failure ]
crbug.com/528062 [ Win ] virtual/mojo-loading/http/tests/security/xssAuditor/chunked-big-script.html [ Failure ]
crbug.com/392706 virtual/threaded/animations/play-state-initially-paused.html [ Failure ]
# Added Linux in crbug.com/750549
# Part of a larger issue referenced in the bug. This specific issue will be fixed shortly.
crbug.com/408159 accessibility/is-ignored-change-sends-notification.html [ Timeout ]
......
Warning this test is running in real-time and may be flaky.
PASS - "left" property for "animation1" element at 0s saw something close to: 150
PASS - "left" property for "animation2" element at 0s saw something close to: 100
PASS - "left" property for "animation3" element at 0s saw something close to: 0
PASS - "left" property for "animation1" element at 0.3s saw something close to: 150
PASS - "left" property for "animation2" element at 0.3s saw something close to: 100
PASS - "left" property for "animation1" element at 0.5s saw something close to: 175
PASS - "left" property for "animation2" element at 0.5s saw something close to: 125
PASS - "left" property for "animation3" element at 0.5s saw something close to: 0
PASS - "left" property for "animation1" element at 0.6s saw something close to: 200
PASS - "left" property for "animation2" element at 0.6s saw something close to: 150
PASS - "left" property for "animation3" element at 0.7s saw something close to: 125
PASS - "left" property for "animation1" element at 0.8s saw something close to: 250
PASS - "left" property for "animation2" element at 0.8s saw something close to: 200
PASS - "left" property for "animation3" element at 0.8s saw something close to: 150
PASS - "left" property for "animation1" element at 1s saw something close to: 300
PASS - "left" property for "animation2" element at 1s saw something close to: 250
PASS - "left" property for "animation3" element at 1s saw something close to: 200
PASS - "left" property for "animation1" element at 1.2s saw something close to: 300
PASS - "left" property for "animation2" element at 1.2s saw something close to: 300
PASS - "left" property for "animation3" element at 1.2s saw something close to: 250
PASS - "left" property for "animation2" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.6s saw something close to: 300
<!DOCTYPE html>
<html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<style type="text/css">
.target {
position: relative;
......@@ -9,83 +11,62 @@
background-color: red;
left: 0px;
margin-bottom: 10px;
animation: test 0.8s linear forwards;
animation-play-state: paused;
animation: test 0.8s linear forwards;
animation: test 5s linear forwards;
animation-play-state: paused;
}
.running {
animation-play-state: running;
animation-play-state: running;
}
#animation1 {
animation-delay: -0.2s;
animation-delay: -0.2s;
animation-delay: -4.7s;
}
#animation2 {
animation-delay: 0s;
animation-delay: 0s;
}
#animation3 {
animation-delay: 0.2s;
animation-delay: 0.2s;
}
@keyframes test {
from { left: 100px; }
to { left: 300px; }
animation-delay: 0.1s;
}
@keyframes test {
from { left: 100px; }
to { left: 300px; }
to { left: 600px; }
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript"></script>
<script type="text/javascript">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.0, "animation1", "left", 150, 0],
[0.3, "animation1", "left", 150, 0],
[0.5, "animation1", "left", 175, 15],
[0.6, "animation1", "left", 200, 15],
[0.8, "animation1", "left", 250, 15],
[1.0, "animation1", "left", 300, 15],
[1.2, "animation1", "left", 300, 0],
</head>
<body>
<div class="target" id="animation1"></div>
<div class="target" id="animation2"></div>
<div class="target" id="animation3"></div>
<script>
'use strict';
var t = async_test('An animation which is initially paused produces the correct output when first created, and can be unpaused.');
[0.0, "animation2", "left", 100, 0],
[0.3, "animation2", "left", 100, 0],
[0.5, "animation2", "left", 125, 15],
[0.6, "animation2", "left", 150, 15],
[0.8, "animation2", "left", 200, 15],
[1.0, "animation2", "left", 250, 15],
[1.2, "animation2", "left", 300, 15],
[1.4, "animation2", "left", 300, 0],
setTimeout(t.step_func(() => { // this set timeout should be ok in the test environment
assert_equals(getComputedStyle(animation1).left, '570px');
assert_equals(getComputedStyle(animation2).left, '100px');
assert_equals(getComputedStyle(animation3).left, '0px');
[0.0, "animation3", "left", 0, 0],
[0.5, "animation3", "left", 0, 0],
[0.7, "animation3", "left", 125, 15],
[0.8, "animation3", "left", 150, 15],
[1.0, "animation3", "left", 200, 15],
[1.2, "animation3", "left", 250, 15],
[1.4, "animation3", "left", 300, 15],
[1.6, "animation3", "left", 300, 0],
];
animation1.addEventListener('animationend', t.step_func_done(finished));
function run() {
var targets = document.getElementsByClassName('target');
for (var i = 0; i < targets.length; ++i) {
targets[i].classList.add('running');
}
}
var disablePauseAnimationAPI = true;
runAnimationTest(expectedValues, {0.4: run}, null, disablePauseAnimationAPI);
assert_equals(getComputedStyle(animation1).left, '570px');
assert_equals(getComputedStyle(animation2).left, '100px');
assert_equals(getComputedStyle(animation3).left, '0px');
}), 102); // arbitrary
function finished() {
var left1 = parseFloat(getComputedStyle(animation1).left);
var left2 = parseFloat(getComputedStyle(animation2).left);
var left3 = parseFloat(getComputedStyle(animation3).left);
assert_equals(left1, 600);
assert_greater_than(left1, left2);
assert_greater_than(left2, left3);
assert_greater_than_equal(left3, 120);
}
</script>
</head>
<body>
<p>This tests that an animation which is initially paused produces the correct output when first created, and can be unpaused.</p>
<div class="target" id="animation1"></div>
<div class="target" id="animation2"></div>
<div class="target" id="animation3"></div>
<div id="result"></div>
</body>
</html>
Warning this test is running in real-time and may be flaky.
PASS - "left" property for "animation1" element at 0s saw something close to: 150
PASS - "left" property for "animation2" element at 0s saw something close to: 100
PASS - "left" property for "animation3" element at 0s saw something close to: 0
PASS - "left" property for "animation1" element at 0.3s saw something close to: 150
PASS - "left" property for "animation2" element at 0.3s saw something close to: 100
PASS - "left" property for "animation1" element at 0.5s saw something close to: 175
PASS - "left" property for "animation2" element at 0.5s saw something close to: 125
PASS - "left" property for "animation3" element at 0.5s saw something close to: 0
FAIL - "left" property for "animation1" element at 0.6s expected: 200 but saw: 216.57875061035156
FAIL - "left" property for "animation2" element at 0.6s expected: 150 but saw: 166.57875061035156
FAIL - "left" property for "animation3" element at 0.7s expected: 125 but saw: 141.6024932861328
FAIL - "left" property for "animation1" element at 0.8s expected: 250 but saw: 275.8292541503906
FAIL - "left" property for "animation2" element at 0.8s expected: 200 but saw: 225.82925415039062
FAIL - "left" property for "animation3" element at 0.8s expected: 150 but saw: 175.82925415039062
PASS - "left" property for "animation1" element at 1s saw something close to: 300
FAIL - "left" property for "animation2" element at 1s expected: 250 but saw: 274.9184875488281
FAIL - "left" property for "animation3" element at 1s expected: 200 but saw: 224.9185028076172
PASS - "left" property for "animation1" element at 1.2s saw something close to: 300
PASS - "left" property for "animation2" element at 1.2s saw something close to: 300
PASS - "left" property for "animation3" element at 1.2s saw something close to: 250
PASS - "left" property for "animation2" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.6s saw something close to: 300
Warning this test is running in real-time and may be flaky.
PASS - "left" property for "animation1" element at 0s saw something close to: 150
PASS - "left" property for "animation2" element at 0s saw something close to: 100
PASS - "left" property for "animation3" element at 0s saw something close to: 0
PASS - "left" property for "animation1" element at 0.3s saw something close to: 150
PASS - "left" property for "animation2" element at 0.3s saw something close to: 100
FAIL - "left" property for "animation1" element at 0.5s expected: 175 but saw: 191.60650634765625
FAIL - "left" property for "animation2" element at 0.5s expected: 125 but saw: 141.60650634765625
PASS - "left" property for "animation3" element at 0.5s saw something close to: 0
FAIL - "left" property for "animation1" element at 0.6s expected: 200 but saw: 237.69500732421875
FAIL - "left" property for "animation2" element at 0.6s expected: 150 but saw: 187.69500732421875
PASS - "left" property for "animation3" element at 0.7s saw something close to: 125
FAIL - "left" property for "animation1" element at 0.8s expected: 250 but saw: 279.1232604980469
FAIL - "left" property for "animation2" element at 0.8s expected: 200 but saw: 229.1232452392578
FAIL - "left" property for "animation3" element at 0.8s expected: 150 but saw: 179.1232452392578
PASS - "left" property for "animation1" element at 1s saw something close to: 300
FAIL - "left" property for "animation2" element at 1s expected: 250 but saw: 270.7560119628906
FAIL - "left" property for "animation3" element at 1s expected: 200 but saw: 220.75599670410156
PASS - "left" property for "animation1" element at 1.2s saw something close to: 300
PASS - "left" property for "animation2" element at 1.2s saw something close to: 300
PASS - "left" property for "animation3" element at 1.2s saw something close to: 250
PASS - "left" property for "animation2" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.6s saw something close to: 300
Warning this test is running in real-time and may be flaky.
PASS - "left" property for "animation1" element at 0s saw something close to: 150
PASS - "left" property for "animation2" element at 0s saw something close to: 100
PASS - "left" property for "animation3" element at 0s saw something close to: 0
PASS - "left" property for "animation1" element at 0.3s saw something close to: 150
PASS - "left" property for "animation2" element at 0.3s saw something close to: 100
PASS - "left" property for "animation1" element at 0.5s saw something close to: 175
PASS - "left" property for "animation2" element at 0.5s saw something close to: 125
PASS - "left" property for "animation3" element at 0.5s saw something close to: 0
PASS - "left" property for "animation1" element at 0.6s saw something close to: 200
PASS - "left" property for "animation2" element at 0.6s saw something close to: 150
PASS - "left" property for "animation3" element at 0.7s saw something close to: 125
PASS - "left" property for "animation1" element at 0.8s saw something close to: 250
PASS - "left" property for "animation2" element at 0.8s saw something close to: 200
PASS - "left" property for "animation3" element at 0.8s saw something close to: 150
PASS - "left" property for "animation1" element at 1s saw something close to: 300
FAIL - "left" property for "animation2" element at 1s expected: 250 but saw: 266.9020080566406
FAIL - "left" property for "animation3" element at 1s expected: 200 but saw: 216.90199279785156
PASS - "left" property for "animation1" element at 1.2s saw something close to: 300
PASS - "left" property for "animation2" element at 1.2s saw something close to: 300
FAIL - "left" property for "animation3" element at 1.2s expected: 250 but saw: 271.02325439453125
PASS - "left" property for "animation2" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.6s saw something close to: 300
Warning this test is running in real-time and may be flaky.
PASS - "left" property for "animation1" element at 0s saw something close to: 150
PASS - "left" property for "animation2" element at 0s saw something close to: 100
PASS - "left" property for "animation3" element at 0s saw something close to: 0
PASS - "left" property for "animation1" element at 0.3s saw something close to: 150
PASS - "left" property for "animation2" element at 0.3s saw something close to: 100
PASS - "left" property for "animation1" element at 0.5s saw something close to: 175
PASS - "left" property for "animation2" element at 0.5s saw something close to: 125
PASS - "left" property for "animation3" element at 0.5s saw something close to: 0
FAIL - "left" property for "animation1" element at 0.6s expected: 200 but saw: 233.75
FAIL - "left" property for "animation2" element at 0.6s expected: 150 but saw: 183.75
PASS - "left" property for "animation3" element at 0.7s saw something close to: 125
FAIL - "left" property for "animation1" element at 0.8s expected: 250 but saw: 287.75
FAIL - "left" property for "animation2" element at 0.8s expected: 200 but saw: 237.75
FAIL - "left" property for "animation3" element at 0.8s expected: 150 but saw: 187.75
PASS - "left" property for "animation1" element at 1s saw something close to: 300
FAIL - "left" property for "animation2" element at 1s expected: 250 but saw: 271
FAIL - "left" property for "animation3" element at 1s expected: 200 but saw: 221
PASS - "left" property for "animation1" element at 1.2s saw something close to: 300
PASS - "left" property for "animation2" element at 1.2s saw something close to: 300
PASS - "left" property for "animation3" element at 1.2s saw something close to: 250
PASS - "left" property for "animation2" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.4s saw something close to: 300
PASS - "left" property for "animation3" element at 1.6s saw something close to: 300
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