Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / animation-constructor.html
blob6c131ee9f7daa6ce4b85950fbc05f9580775b30b
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <div id='e'></div>
7 <script>
8 var element = document.getElementById('e');
10 var keyframes = [{opacity: '1'}, {opacity: '0'}];
11 var timingObject = {duration: 2, iterations: 5};
13 test(function() {
14 var keyframeEffect = new KeyframeEffect(element, keyframes, timingObject);
15 assert_not_equals(keyframeEffect, undefined);
16 assert_equals(keyframeEffect.constructor, KeyframeEffect);
17 }, 'Calling new KeyframeEffect() with a timing object input should create an keyframeEffect.');
19 test(function() {
20 var keyframeEffect = new KeyframeEffect(element, keyframes, 2);
21 assert_not_equals(keyframeEffect, undefined);
22 assert_equals(keyframeEffect.constructor, KeyframeEffect);
23 }, 'Calling new KeyframeEffect() with a duration input should create an keyframeEffect.');
25 test(function() {
26 var keyframeEffect = new KeyframeEffect(element, keyframes);
27 assert_not_equals(keyframeEffect, undefined);
28 assert_equals(keyframeEffect.constructor, KeyframeEffect);
29 }, 'Calling new KeyframeEffect() with no timing input should create an keyframeEffect.');
31 test(function() {
32 var keyframeEffect = new KeyframeEffect(null, keyframes);
33 assert_not_equals(keyframeEffect, undefined);
34 assert_equals(keyframeEffect.constructor, KeyframeEffect);
35 }, 'Calling new KeyframeEffect() with no target should create an keyframeEffect.');
36 </script>