blob: 1ac90da1d31a4795f58a4e0d65f9e2d931777c6a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/animation-test-helpers.js"></script>
<style>
@keyframes TheAnimation {
from {
font-weight: 100;
}
to {
font-weight: 500;
}
}
#box {
font-size: 100px;
animation-duration: 3s;
animation-timing-function: linear;
}
</style>
</head>
<body>
<div id="box">Hello</div>
<div id="result"></div>
<script>
var expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["TheAnimation", 0.5, "box", "font-weight", "166.6666", 20],
["TheAnimation", 1.0, "box", "font-weight", "233.3333", 20],
["TheAnimation", 2.0, "box", "font-weight", "366.6666", 20],
];
var promises = [];
document.fonts.forEach(function(f) {
promises.push(f.loaded);
});
Promise.all(promises).then(function() {
document.getElementById("box").style.animationName = "TheAnimation";
runAnimationTest(expectedValues, undefined, undefined, undefined, false, undefined);
});
</script>
</body>
</html>