Skip to content

Commit 535973a

Browse files
[ iOS wk2 ] animations/play-state-paused.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=212641 <rdar://problem/63879230> Reviewed by Dean Jackson. Rewrite this test to use the AnimationTest helper that will non-flakily check animated values while an animation is running. * animations/play-state-paused-expected.txt: * animations/play-state-paused.html: * platform/ios-wk2/TestExpectations: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@262548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent bf1a7be commit 535973a

File tree

4 files changed

+56
-50
lines changed

4 files changed

+56
-50
lines changed

LayoutTests/ChangeLog

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2020-06-04 Antoine Quint <[email protected]>
2+
3+
[ iOS wk2 ] animations/play-state-paused.html is flaky failing.
4+
https://bugs.webkit.org/show_bug.cgi?id=212641
5+
<rdar://problem/63879230>
6+
7+
Reviewed by Dean Jackson.
8+
9+
Rewrite this test to use the AnimationTest helper that will non-flakily check animated values while an animation is running.
10+
11+
* animations/play-state-paused-expected.txt:
12+
* animations/play-state-paused.html:
13+
* platform/ios-wk2/TestExpectations:
14+
115
2020-06-02 Chris Dumez <[email protected]>
216

317
Resync web-platform-tests/2dcontext from upstream
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
PASS - "margin-left" property for "box" element at 0.5s saw something close to: 75
2-
PASS - "margin-left" property for "box" element at 1s saw something close to: 150
3-
PASS - "margin-left" property for "box" element at 2.5s saw something close to: 150
1+
2+
PASS Pausing an animation using the animation-play-state property stops animating styles.
43

+40-45
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5-
<title>Test of -webkit-animation-play-state</title>
6-
<style type="text/css" media="screen">
5+
<title>Test of animation-play-state</title>
6+
<style>
77
body {
88
margin: 0;
99
}
@@ -16,57 +16,52 @@
1616
width: 100px;
1717
background-color: red;
1818
margin: 0;
19-
-webkit-animation-duration: 2s;
20-
-webkit-animation-timing-function: linear;
21-
-webkit-animation-name: "move1";
22-
-webkit-animation-play-state: running;
19+
animation-duration: 2s;
20+
animation-timing-function: linear;
21+
animation-name: move;
22+
animation-play-state: running;
2323
}
24-
#safezone {
25-
position: absolute;
26-
top: 100px;
27-
height: 100px;
28-
width: 200px;
29-
left: 100px;
30-
background-color: green;
31-
}
32-
@-webkit-keyframes "move1" {
24+
25+
@keyframes move {
3326
from { margin-left: 0px; }
3427
to { margin-left: 300px; }
3528
}
36-
#result {
37-
color: white; /* hide from pixel results */
38-
}
3929
</style>
40-
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
41-
<script type="text/javascript" charset="utf-8">
42-
const expectedValues = [
43-
// [animation-name, time, element-id, property, expected-value, tolerance]
44-
["move1", 0.5, "box", "margin-left", 75, 20],
45-
["move1", 1.0, "box", "margin-left", 150, 20],
46-
["move1", 2.5, "box", "margin-left", 150, 20],
47-
];
30+
<script src="../resources/testharness.js"></script>
31+
<script src="../resources/testharnessreport.js"></script>
32+
<script src="resources/animation-test.js"></script>
33+
</head>
34+
<body>
35+
<div id="box"></div>
36+
<script>
4837

49-
function pauseAnimation()
50-
{
51-
const box = document.getElementById("box");
52-
box.style.webkitAnimationPlayState = "paused";
53-
box.getAnimations()[0].currentTime = 1000;
54-
}
38+
async_test(async t => {
39+
const delay = 100;
5540

56-
function setTimers()
57-
{
58-
setTimeout(pauseAnimation, 1000);
59-
}
41+
const test = new AnimationTest({
42+
target: document.getElementById("box"),
43+
styleExtractor: style => parseFloat(style.marginLeft)
44+
});
6045

61-
runAnimationTest(expectedValues, setTimers, null, true);
46+
// Record two computed values after the specified delay each.
47+
await test.recordValueAfterRunningFor(delay);
48+
await test.recordValueAfterRunningFor(delay);
6249

63-
</script>
64-
</head>
65-
<body>
66-
<!-- This tests the operation of -webkit-animation-play-state. After 1 second the red boxes should be hidden by the green boxes. You should see no red boxes. -->
67-
<div id="box"></div>
68-
<div id="safezone"></div>
69-
<div id="result"></div>
50+
// We'll now pause the animation using the CSS property "animation-play-state".
51+
box.style.animationPlayState = "paused";
52+
53+
// And now we'll record values after the specified delay each and check that those are the same.
54+
const initialPausedValue = await test.valueAfterWaitingFor(delay);
55+
const currentPausedValue = await test.valueAfterWaitingFor(delay);
56+
assert_equals(initialPausedValue, currentPausedValue, "Values recorded while paused are the same.");
57+
58+
// Finally, check the values recorded earlier in the test.
59+
test.checkRecordedValues();
60+
61+
t.done();
62+
}, `Pausing an animation using the animation-play-state property stops animating styles.`);
63+
64+
</script>
7065
</div>
7166
</body>
7267
</html>

LayoutTests/platform/ios-wk2/TestExpectations

-2
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,4 @@ webkit.org/b/186045 [ Release ] imported/w3c/web-platform-tests/css/css-display/
17541754
webkit.org/b/212532 http/wpt/service-workers/service-worker-crashing-while-fetching.https.html [ Pass Failure ]
17551755
webkit.org/b/212532 http/wpt/service-workers/service-worker-different-process.https.html [ Pass Failure ]
17561756

1757-
webkit.org/b/212641 animations/play-state-paused.html [ Pass Failure ]
1758-
17591757
webkit.org/b/212696 imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https.html [ Pass Failure ]

0 commit comments

Comments
 (0)