mirror of
https://github.com/servo/servo.git
synced 2025-09-01 18:48:23 +01:00
Update web-platform-tests to revision 0d9238c8062f05a55898a0cb60dc0c353794d87a
This commit is contained in:
parent
c80fa33864
commit
7e8624d921
57 changed files with 5290 additions and 266 deletions
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Animation constructor tests</title>
|
||||
<link rel="help" href="http://w3c.github.io/web-animations/#dom-animation-animation">
|
||||
<link rel="author" title="Hiroyuki Ikezoe" href="mailto:hiikezoe@mozilla-japan.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../testcommon.js"></script>
|
||||
<link rel="stylesheet" href="/resources/testharness.css">
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
var gTarget = document.getElementById("target");
|
||||
var gEffect = new KeyframeEffectReadOnly(gTarget, { opacity: [0, 1] });
|
||||
|
||||
var gTestArguments = [
|
||||
{
|
||||
effect: null,
|
||||
timeline: null,
|
||||
description: "with null effect and null timeline"
|
||||
},
|
||||
{
|
||||
effect: null,
|
||||
timeline: document.timeline,
|
||||
description: "with null effect and non-null timeline"
|
||||
},
|
||||
{
|
||||
effect: gEffect,
|
||||
timeline: null,
|
||||
description: "with non-null effect and null timeline"
|
||||
},
|
||||
{
|
||||
effect: gEffect,
|
||||
timeline: document.timeline,
|
||||
description: "with non-null effect and non-null timeline"
|
||||
},
|
||||
];
|
||||
|
||||
gTestArguments.forEach(function(args) {
|
||||
test(function(t) {
|
||||
var animation = new Animation(args.effect, args.timeline);
|
||||
|
||||
assert_not_equals(animation, null,
|
||||
"An animation sohuld be created");
|
||||
assert_equals(animation.effect, args.effect,
|
||||
"Animation returns the same effect passed to " +
|
||||
"the Constructor");
|
||||
assert_equals(animation.timeline, args.timeline,
|
||||
"Animation returns the same timeline passed to " +
|
||||
"the Constructor");
|
||||
assert_equals(animation.playState, "idle",
|
||||
"Animation.playState should be initially 'idle'");
|
||||
}, "Animation can be constructed " + args.description);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue