Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317

This commit is contained in:
Josh Matthews 2018-01-04 13:44:24 -05:00
parent aa199307c8
commit 2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions

View file

@ -1,7 +1,7 @@
<!doctype html>
<meta charset=utf-8>
<title>Document timelines</title>
<link rel="help" href="https://w3c.github.io/web-animations/#document-timelines">
<link rel="help" href="https://drafts.csswg.org/web-animations/#document-timelines">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
@ -9,7 +9,7 @@
<script>
'use strict';
async_test(function(t) {
async_test(t => {
assert_true(document.timeline.currentTime > 0,
'The current time is initially is positive');
// document.timeline.currentTime should be set even before document
@ -25,8 +25,8 @@ async_test(function(t) {
// We can't just compare document.timeline.currentTime to
// window.performance.now() because currentTime is only updated on a sample
// so we use requestAnimationFrame instead.
window.requestAnimationFrame(function(rafTime) {
t.step(function() {
window.requestAnimationFrame(rafTime => {
t.step(() => {
assert_equals(document.timeline.currentTime, rafTime,
'The current time matches requestAnimationFrame time');
});

View file

@ -1,7 +1,7 @@
<!doctype html>
<meta charset=utf-8>
<title>Timelines</title>
<link rel="help" href="https://w3c.github.io/web-animations/#timelines">
<link rel="help" href="https://drafts.csswg.org/web-animations/#timelines">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
@ -9,7 +9,7 @@
<script>
'use strict';
promise_test(function(t) {
promise_test(t => {
const valueAtStart = document.timeline.currentTime;
const timeAtStart = window.performance.now();
while (window.performance.now() - timeAtStart < 50) {
@ -17,13 +17,13 @@ promise_test(function(t) {
}
assert_equals(document.timeline.currentTime, valueAtStart,
'Timeline time does not change within an animation frame');
return waitForAnimationFrames(1).then(function() {
return waitForAnimationFrames(1).then(() => {
assert_greater_than(document.timeline.currentTime, valueAtStart,
'Timeline time increases between animation frames');
});
}, 'Timeline time increases once per animation frame');
async_test(function(t) {
async_test(t => {
const iframe = document.createElement('iframe');
iframe.width = 10;
iframe.height = 10;
@ -49,20 +49,20 @@ async_test(function(t) {
document.body.appendChild(iframe);
}, 'Timeline time increases once per animation frame in an iframe');
async_test(function(t) {
async_test(t => {
const startTime = document.timeline.currentTime;
let firstRafTime;
requestAnimationFrame(function() {
t.step(function() {
requestAnimationFrame(() => {
t.step(() => {
assert_greater_than_equal(document.timeline.currentTime, startTime,
'Timeline time should have progressed');
firstRafTime = document.timeline.currentTime;
});
});
requestAnimationFrame(function() {
t.step(function() {
requestAnimationFrame(() => {
t.step(() => {
assert_equals(document.timeline.currentTime, firstRafTime,
'Timeline time should be the same');
});
@ -71,4 +71,17 @@ async_test(function(t) {
}, 'Timeline time should be the same for all RAF callbacks in an animation'
+ ' frame');
async_test(t => {
const div = createDiv(t);
const animation = div.animate(null, 100 * MS_PER_SEC);
animation.ready.then(t.step_func(() => {
const readyTimelineTime = document.timeline.currentTime;
requestAnimationFrame(t.step_func_done(() => {
assert_equals(readyTimelineTime, document.timeline.currentTime,
'There should be a microtask checkpoint');
}));
}));
}, 'Performs a microtask checkpoint after updating timelins');
</script>