undefined reference to 'JSC::B3::BasicBlock::fallThrough() const
[WebKit-https.git] / LayoutTests / http / wpt / web-animations / interfaces / KeyframeEffectReadOnly / copy-constructor.html
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>KeyframeEffectReadOnly copy constructor tests</title>
4 <link rel="help"
5 href="https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly-source">
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <script src="../../testcommon.js"></script>
9 <body>
10 <div id="log"></div>
11 <script>
12 "use strict";
13
14 test(function(t) {
15   var effect = new KeyframeEffectReadOnly(createDiv(t), null);
16   var copiedEffect = new KeyframeEffectReadOnly(effect);
17   assert_equals(copiedEffect.target, effect.target, 'same target');
18 }, 'Test copied keyframeEffectReadOnly has the same target');
19
20 test(function(t) {
21   var effect =
22     new KeyframeEffectReadOnly(null,
23                                [ { marginLeft: '0px' },
24                                  { marginLeft: '-20px', easing: 'ease-in',
25                                    offset: 0.1 },
26                                  { marginLeft: '100px', easing: 'ease-out' },
27                                  { marginLeft: '50px' } ],
28                                { spacing: 'paced(margin-left)' });
29
30   var copiedEffect = new KeyframeEffectReadOnly(effect);
31   var KeyframesA = effect.getKeyframes();
32   var KeyframesB = copiedEffect.getKeyframes();
33   assert_equals(KeyframesA.length, KeyframesB.length, 'same keyframes length');
34
35   for (var i = 0; i < KeyframesA.length; ++i) {
36     assert_equals(KeyframesA[i].offset, KeyframesB[i].offset,
37                   'Keyframe ' + i + ' has the same offset');
38     assert_equals(KeyframesA[i].computedOffset, KeyframesB[i].computedOffset,
39                   'keyframe ' + i + ' has the same computedOffset');
40     assert_equals(KeyframesA[i].easing, KeyframesB[i].easing,
41                   'keyframe ' + i + ' has the same easing');
42     assert_equals(KeyframesA[i].composite, KeyframesB[i].composite,
43                   'keyframe ' + i + ' has the same composite');
44
45     assert_true(!!KeyframesA[i].marginLeft,
46                 'original keyframe ' + i + ' has the valid property value');
47     assert_true(!!KeyframesB[i].marginLeft,
48                 'new keyframe ' + i + ' has the valid property value');
49     assert_equals(KeyframesA[i].marginLeft, KeyframesB[i].marginLeft,
50                   'keyframe ' + i + ' has the same property value pair');
51   }
52 }, 'Test copied keyframeEffectReadOnly has the same keyframes');
53
54 test(function(t) {
55   var effect = new KeyframeEffectReadOnly(null, null,
56                                           { spacing: 'paced(margin-left)',
57                                             iterationComposite: 'accumulate' });
58
59   var copiedEffect = new KeyframeEffectReadOnly(effect);
60   assert_equals(copiedEffect.spacing, effect.spacing, 'same spacing');
61   assert_equals(copiedEffect.iterationComposite, effect.iterationComposite,
62                 'same iterationCompositeOperation');
63   assert_equals(copiedEffect.composite, effect.composite,
64                 'same compositeOperation');
65 }, 'Test copied keyframeEffectReadOnly has the same keyframeEffectOptions');
66
67 test(function(t) {
68   var effect = new KeyframeEffectReadOnly(null, null,
69                                           { duration: 100 * MS_PER_SEC,
70                                             delay: -1 * MS_PER_SEC,
71                                             endDelay: 2 * MS_PER_SEC,
72                                             fill: 'forwards',
73                                             iterationStart: 2,
74                                             iterations: 20,
75                                             easing: 'ease-out',
76                                             direction: 'alternate' } );
77
78   var copiedEffect = new KeyframeEffectReadOnly(effect);
79   var timingA = effect.timing;
80   var timingB = copiedEffect.timing;
81   assert_not_equals(timingA, timingB, 'different timing objects');
82   assert_equals(timingA.delay, timingB.delay, 'same delay');
83   assert_equals(timingA.endDelay, timingB.endDelay, 'same endDelay');
84   assert_equals(timingA.fill, timingB.fill, 'same fill');
85   assert_equals(timingA.iterationStart, timingB.iterationStart,
86                 'same iterationStart');
87   assert_equals(timingA.iterations, timingB.iterations, 'same iterations');
88   assert_equals(timingA.duration, timingB.duration, 'same duration');
89   assert_equals(timingA.direction, timingB.direction, 'same direction');
90   assert_equals(timingA.easing, timingB.easing, 'same easing');
91 }, 'Test copied keyframeEffectReadOnly has the same timing content');
92
93 </script>
94 </body>