Bug 1402170 - Move tests for easing values on keyframes to processing-a-keyframes-argument-002.html; r=hiro

MozReview-Commit-ID: LEydYxdMoay

--HG--
extra : rebase_source : 5fa9abd6b2a0e1f796da11931332adef392bc3c2
This commit is contained in:
Brian Birtles 2017-09-22 15:58:37 +09:00
Родитель 6610802e22
Коммит d8fba27f62
3 изменённых файлов: 73 добавлений и 47 удалений

Просмотреть файл

@ -379875,6 +379875,12 @@
{}
]
],
"web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html": [
[
"/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html",
{}
]
],
"web-animations/interfaces/KeyframeEffect/setKeyframes.html": [
[
"/web-animations/interfaces/KeyframeEffect/setKeyframes.html",
@ -631211,7 +631217,7 @@
"testharness"
],
"web-animations/interfaces/KeyframeEffect/constructor.html": [
"82d2eefd0a3755fc352d7dbe773139a92fee452c",
"118fe0f52ea654d57411598061b651bdde45ea7c",
"testharness"
],
"web-animations/interfaces/KeyframeEffect/copy-contructor.html": [
@ -631230,6 +631236,10 @@
"e134685cad160d4c4abd6fd4917e26f87f4ae8df",
"testharness"
],
"web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html": [
"75176cb31c3c829fa7ce5fb58cbf4c97160b5d99",
"testharness"
],
"web-animations/interfaces/KeyframeEffect/setKeyframes.html": [
"2982bb6f57bb52c6e4e0483e4e47b22868a6010d",
"testharness"

Просмотреть файл

@ -28,34 +28,6 @@ test(function(t) {
});
}, "a KeyframeEffectReadOnly can be constructed with no frames");
test(function(t) {
gEasingValueTests.forEach(function(subtest) {
var easing = subtest[0];
var expected = subtest[1];
var effect = new KeyframeEffectReadOnly(target, {
left: ["10px", "20px"],
easing: easing
});
assert_equals(effect.getKeyframes()[0].easing, expected,
"resulting easing for '" + easing + "'");
});
}, "easing values are parsed correctly when passed to the " +
"KeyframeEffectReadOnly constructor in a property-indexed keyframe");
test(function(t) {
gEasingValueTests.forEach(function(subtest) {
var easing = subtest[0];
var expected = subtest[1];
var effect = new KeyframeEffectReadOnly(target, [
{ offset: 0, left: "10px", easing: easing },
{ offset: 1, left: "20px" }
]);
assert_equals(effect.getKeyframes()[0].easing, expected,
"resulting easing for '" + easing + "'");
});
}, "easing values are parsed correctly when passed to the " +
"KeyframeEffectReadOnly constructor in regular keyframes");
test(function(t) {
gEasingValueTests.forEach(function(subtest) {
var easing = subtest[0];
@ -69,24 +41,6 @@ test(function(t) {
}, "easing values are parsed correctly when passed to the " +
"KeyframeEffectReadOnly constructor in KeyframeEffectOptions");
test(function(t) {
gInvalidEasings.forEach(invalidEasing => {
assert_throws(new TypeError, () => {
new KeyframeEffectReadOnly(target, { easing: invalidEasing });
}, `TypeError is thrown for easing '${invalidEasing}'`);
});
}, 'invalid easing values are correctly rejected when passed to the ' +
'KeyframeEffectReadOnly constructor in regular keyframes');
test(function(t) {
gInvalidEasings.forEach(invalidEasing => {
assert_throws(new TypeError, () => {
new KeyframeEffectReadOnly(target, [{ easing: invalidEasing }]);
}, `TypeError is thrown for easing '${invalidEasing}'`);
});
}, 'invalid easing values are correctly rejected when passed to the ' +
'KeyframeEffectReadOnly constructor in a keyframe sequence');
test(function(t) {
gInvalidEasings.forEach(invalidEasing => {
assert_throws(new TypeError, () => {

Просмотреть файл

@ -0,0 +1,62 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Tests for processing a keyframes argument (easing)</title>
<link rel="help" href="https://w3c.github.io/web-animations/#processing-a-keyframes-argument">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<script src="../../resources/keyframe-utils.js"></script>
<script src="../../resources/easing-tests.js"></script>
<body>
<div id="log"></div>
<div id="target"></div>
<script>
'use strict';
test(function(t) {
gEasingValueTests.forEach(function(subtest) {
var easing = subtest[0];
var expected = subtest[1];
var effect = new KeyframeEffectReadOnly(target, {
left: ["10px", "20px"],
easing: easing
});
assert_equals(effect.getKeyframes()[0].easing, expected,
"resulting easing for '" + easing + "'");
});
}, "easing values are parsed correctly when passed to the " +
"KeyframeEffectReadOnly constructor in a property-indexed keyframe");
test(function(t) {
gEasingValueTests.forEach(function(subtest) {
var easing = subtest[0];
var expected = subtest[1];
var effect = new KeyframeEffectReadOnly(target, [
{ offset: 0, left: "10px", easing: easing },
{ offset: 1, left: "20px" }
]);
assert_equals(effect.getKeyframes()[0].easing, expected,
"resulting easing for '" + easing + "'");
});
}, "easing values are parsed correctly when passed to the " +
"KeyframeEffectReadOnly constructor in regular keyframes");
test(function(t) {
gInvalidEasings.forEach(invalidEasing => {
assert_throws(new TypeError, () => {
new KeyframeEffectReadOnly(target, { easing: invalidEasing });
}, `TypeError is thrown for easing '${invalidEasing}'`);
});
}, 'invalid easing values are correctly rejected when passed to the ' +
'KeyframeEffectReadOnly constructor in regular keyframes');
test(function(t) {
gInvalidEasings.forEach(invalidEasing => {
assert_throws(new TypeError, () => {
new KeyframeEffectReadOnly(target, [{ easing: invalidEasing }]);
}, `TypeError is thrown for easing '${invalidEasing}'`);
});
}, 'invalid easing values are correctly rejected when passed to the ' +
'KeyframeEffectReadOnly constructor in a keyframe sequence');
</script>