blob: b97bd345e7d1a253fc51c1176aabcea6a8cb9ea8 [file] [log] [blame]
<!doctype html>
<html lang="en">
<head>
<style>
body {
margin: 0;
}
#box1, #box2 {
position: relative;
height: 25px;
width: 100px;
margin: 5px;
background: lightsteelblue;
}
.move1 {
-webkit-animation-name: move1;
-webkit-animation-delay: 0.5s;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
}
@-webkit-keyframes move1 {
from { left: 0px; }
to { left: 200px; }
}
.move2 {
-webkit-animation-name: move2;
-webkit-animation-delay: 0.5s;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
}
@-webkit-keyframes move2 {
from { left: 0px; }
to { left: 200px; }
}
</style>
<script src="resources/animation-test-helpers.js"></script>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
}
window.onload = function() {
document.querySelector('#box1').classList.add('move1');
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
[null, 0.5, "box1", "left", 100, 10],
[null, 1.5, "box2", "left", 100, 10],
];
const callbacks = {
// Start the animation on box2 500ms after the first animation
0.5: function() { document.querySelector('#box2').classList.add('move2'); }
};
// FIXME: Consider whether we can support this kind of test (staggered start) under the pause API
runAnimationTest(expectedValues, callbacks, null, 'do-not-use-pause-api');
}
</script>
</head>
<body>
<div id="box1">starts after 1s</div>
<div id="box2">starts after 1.5s</div>
<div id="result"></div>
</div>
</body>
</html>