Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / web-animations-api / timed-item-specified-getters.html
blob40952e03b6657a343afa54b164827f7bb2aca464
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
5 <body>
6 <div id='e'></div>
7 </body>
9 <script>
10 var element = document.getElementById('e');
11 var keyframes = [{opacity: '1', offset: 0}, {opacity: '0', offset: 1}];
13 var keyframeEffectBasic = new KeyframeEffect(element, keyframes);
14 var specifiedTimingBasic = keyframeEffectBasic.timing;
16 var timingNumberDuration = {duration: 2};
17 var animationNumberDuration = new KeyframeEffect(element, keyframes, timingNumberDuration);
18 var specifiedTimingNumberDuration = animationNumberDuration.timing;
20 var timingNoDuration = {iterations: 3};
21 var animationNoDuration = new KeyframeEffect(element, keyframes, timingNoDuration);
22 var specifiedTimingNoDuration = animationNoDuration.timing;
24 var timingAllFields = {
25 delay: 2,
26 endDelay: 0.5,
27 fill: 'backwards',
28 iterationStart: 2,
29 iterations: 10,
30 duration: 5,
31 playbackRate: 2,
32 direction: 'reverse',
33 easing: 'step-start'
35 var animationAllFields = new KeyframeEffect(element, keyframes, timingAllFields);
36 var specifiedTimingAllFields = animationAllFields.timing;
38 test(function() {
39 assert_equals(specifiedTimingBasic.constructor, AnimationEffectTiming);
40 assert_equals(specifiedTimingBasic.delay, 0);
41 assert_equals(specifiedTimingBasic.endDelay, 0);
42 assert_equals(specifiedTimingBasic.fill, 'auto');
43 assert_equals(specifiedTimingBasic.iterationStart, 0);
44 assert_equals(specifiedTimingBasic.iterations, 1);
45 assert_equals(specifiedTimingBasic.duration, 'auto');
46 assert_equals(specifiedTimingBasic.playbackRate, 1);
47 assert_equals(specifiedTimingBasic.direction, 'normal');
48 assert_equals(specifiedTimingBasic.easing, 'linear');
49 }, 'TimedItem.timing should return a TimedItemTiming, which should have a getter for each member of the underlying Timing object.');
51 test(function() {
52 assert_equals(specifiedTimingNumberDuration.duration, 2);
53 }, 'TimedItem.timing.duration should return a number when duration was set as a number.');
55 test(function() {
56 assert_equals(specifiedTimingNoDuration.duration, 'auto');
57 }, 'TimedItem.timing.duration should return "auto" when duration was not specified.');
59 test(function() {
60 assert_equals(specifiedTimingAllFields.delay, 2);
61 assert_equals(specifiedTimingAllFields.endDelay, 0.5);
62 assert_equals(specifiedTimingAllFields.fill, 'backwards');
63 assert_equals(specifiedTimingAllFields.iterationStart, 2);
64 assert_equals(specifiedTimingAllFields.iterations, 10);
65 assert_equals(specifiedTimingAllFields.duration, 5);
66 assert_equals(specifiedTimingAllFields.playbackRate, 2);
67 assert_equals(specifiedTimingAllFields.direction, 'reverse');
68 assert_equals(specifiedTimingAllFields.easing, 'step-start');
69 }, 'TimedItem.timing should have a getter for each member of the underlying Timing object.');
70 </script>