Update web-platform-tests to revision e03a9b1341ae9bdb1e4fa03765257b84d26fe2f1

This commit is contained in:
Josh Matthews 2017-10-16 11:11:04 -04:00
parent 7d05c76d18
commit 20a833eb75
5167 changed files with 4696 additions and 297370 deletions

View file

@ -5,32 +5,37 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<script src="../../resources/effect-tests.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
function runTests(tests, description) {
tests.forEach(function(currentTest) {
var testParams = '';
for (var attr in currentTest.input) {
testParams += ' ' + attr + ':' + currentTest.input[attr];
for (const currentTest of tests) {
let testParams = Object.entries(currentTest.input)
.map(([attr, value]) => `${attr}:${value}`)
.join(' ');
if (currentTest.playbackRate !== undefined) {
testParams += ` playbackRate:${currentTest.playbackRate}`;
}
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, currentTest.input);
assert_equals(anim.effect.getComputedTiming().currentIteration,
currentTest.before);
anim.currentTime = currentTest.input.delay || 0;
assert_equals(anim.effect.getComputedTiming().currentIteration,
currentTest.active);
if (typeof currentTest.after !== 'undefined') {
anim.finish();
assert_equals(anim.effect.getComputedTiming().currentIteration,
currentTest.after);
test(t => {
const div = createDiv(t);
const anim = div.animate({}, currentTest.input);
if (currentTest.playbackRate !== undefined) {
anim.playbackRate = currentTest.playbackRate;
}
}, description + ':' + testParams);
});
assert_computed_timing_for_each_phase(
anim,
'currentIteration',
{ before: currentTest.before,
activeBoundary: currentTest.active,
after: currentTest.after },
);
}, `${description}: ${testParams}`);
}
}
async_test(function(t) {
@ -58,7 +63,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -69,7 +73,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -80,7 +83,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -91,7 +93,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: 2,
after: 2
},
@ -102,7 +103,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: 2,
after: 2
},
@ -113,7 +113,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: 2,
after: 2
},
@ -124,7 +123,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: 3,
after: 3
},
@ -135,7 +133,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: 3,
after: 3
},
@ -146,7 +143,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: 3,
after: 3
}
], 'Test zero iterations');
@ -166,7 +162,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 2,
after: 2
},
@ -198,7 +193,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: 5,
after: 5
},
@ -230,7 +224,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: 5,
after: 5
},
@ -271,7 +264,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 3,
after: 3
},
@ -303,7 +295,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: 5,
after: 5
},
@ -335,7 +326,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: 6,
after: 6
},
@ -376,7 +366,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: Infinity,
after: Infinity
},
@ -407,7 +396,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 2,
active: Infinity,
after: Infinity
},
@ -438,7 +426,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 3,
active: Infinity,
after: Infinity
},
@ -530,7 +517,7 @@ runTests([
endDelay: -50 },
before: 0,
active: 0,
after: 0
after: 1
},
{
@ -552,7 +539,7 @@ runTests([
endDelay: -100 },
before: 0,
active: 0,
after: 0
after: 1
},
{
@ -580,5 +567,54 @@ runTests([
},
], 'Test end delay');
// --------------------------------------------------------------------
//
// Negative playback rate tests
//
// --------------------------------------------------------------------
runTests([
{
input: { duration: 1,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
active: 0,
after: 0
},
{
input: { duration: 1,
delay: 1,
iterations: 2,
fill: 'both' },
playbackRate: -1,
before: 0,
active: 1,
after: 1
},
{
input: { duration: 0,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
after: 0
},
{
input: { duration: 0,
iterations: 0,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
after: 0
},
], 'Test negative playback rate');
</script>
</body>

View file

@ -6,32 +6,37 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<script src="../../resources/effect-tests.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
function runTests(tests, description) {
tests.forEach(function(currentTest) {
var testParams = '';
for (var attr in currentTest.input) {
testParams += ' ' + attr + ':' + currentTest.input[attr];
for (const currentTest of tests) {
let testParams = Object.entries(currentTest.input)
.map(([attr, value]) => `${attr}:${value}`)
.join(' ');
if (currentTest.playbackRate !== undefined) {
testParams += ` playbackRate:${currentTest.playbackRate}`;
}
test(function(t) {
var div = createDiv(t);
var anim = div.animate({ opacity: [ 0, 1 ] }, currentTest.input);
assert_equals(anim.effect.getComputedTiming().progress,
currentTest.before);
anim.currentTime = currentTest.input.delay || 0;
assert_equals(anim.effect.getComputedTiming().progress,
currentTest.active);
if (typeof currentTest.after !== 'undefined') {
anim.finish();
assert_equals(anim.effect.getComputedTiming().progress,
currentTest.after);
test(t => {
const div = createDiv(t);
const anim = div.animate({}, currentTest.input);
if (currentTest.playbackRate !== undefined) {
anim.playbackRate = currentTest.playbackRate;
}
}, description + ':' + testParams);
});
assert_computed_timing_for_each_phase(
anim,
'progress',
{ before: currentTest.before,
activeBoundary: currentTest.active,
after: currentTest.after },
);
}, `${description}: ${testParams}`);
}
}
@ -49,7 +54,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -60,7 +64,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -71,7 +74,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -82,7 +84,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 0.5,
after: 0.5
},
@ -93,7 +94,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 0.5,
after: 0.5
},
@ -104,7 +104,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 0.5,
after: 0.5
},
@ -115,7 +114,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -126,7 +124,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
},
@ -137,7 +134,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0,
after: 0
}
], 'Test zero iterations');
@ -157,7 +153,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 1,
after: 1
},
@ -189,7 +184,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 0.5,
after: 0.5
},
@ -221,7 +215,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 1,
after: 1
},
@ -262,7 +255,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0.5,
after: 0.5
},
@ -294,7 +286,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 1,
after: 1
},
@ -326,7 +317,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 0.5,
after: 0.5
},
@ -367,7 +357,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 1,
after: 1
},
@ -398,7 +387,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0.5,
active: 0.5,
after: 0.5
},
@ -429,7 +417,6 @@ runTests([
delay: 1,
fill: 'both' },
before: 0,
active: 1,
after: 1
},
@ -521,7 +508,7 @@ runTests([
endDelay: -50 },
before: 0.5,
active: 0.5,
after: 1
after: 0
},
{
@ -543,7 +530,7 @@ runTests([
endDelay: -100 },
before: 0,
active: 0,
after: 1
after: 0
},
{
@ -571,5 +558,43 @@ runTests([
},
], 'Test end delay');
// --------------------------------------------------------------------
//
// Negative playback rate tests
//
// --------------------------------------------------------------------
runTests([
{
input: { duration: 1,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
active: 1,
after: 1
},
{
input: { duration: 0,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
after: 1
},
{
input: { duration: 0,
iterations: 0,
delay: 1,
fill: 'both' },
playbackRate: -1,
before: 0,
after: 0
},
], 'Test negative playback rate');
</script>
</body>