Bug 1324554 - Part 3: More tests for test_animation_properties.html. draft
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 02 Feb 2017 11:05:35 +0800
changeset 469531 4e15af70c00f08ca1158a9d6d85ad56be055a2d0
parent 469530 43e1b3c719df8befcbec7d899cd60301e44021f2
child 544226 096f25a79bc85136c0c5d034a457d16d622106ec
push id43755
push userbmo:boris.chiou@gmail.com
push dateThu, 02 Feb 2017 08:40:02 +0000
bugs1324554
milestone54.0a1
Bug 1324554 - Part 3: More tests for test_animation_properties.html. MozReview-Commit-ID: 6MkkP8yNGvg
dom/animation/test/chrome/test_animation_properties.html
--- a/dom/animation/test/chrome/test_animation_properties.html
+++ b/dom/animation/test/chrome/test_animation_properties.html
@@ -704,32 +704,86 @@ var gTests = [
                             value(1, '5px', 'replace') ] },
                 { property: 'margin-bottom',
                   values: [ value(0, undefined, 'add', 'linear'),
                             value(1, '5px', 'replace') ] },
                 { property: 'margin-left',
                   values: [ value(0, undefined, 'add', 'linear'),
                             value(1, '5px', 'replace') ] } ]
   },
+  { desc:     'a missing property in initial keyframe and there are some ' +
+              'keyframes with the same offset',
+    frames:   [ { },
+                { margin: '10px', offset: 0.5 },
+                { margin: '20px', offset: 0.5 },
+                { margin: '30px'} ],
+    expected: [ { property: 'margin-top',
+                  values: [ value(0, undefined, 'add', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1,   '30px', 'replace') ] },
+                { property: 'margin-right',
+                  values: [ value(0, undefined, 'add', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1,   '30px', 'replace') ] },
+                { property: 'margin-bottom',
+                  values: [ value(0, undefined, 'add', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1,   '30px', 'replace') ] },
+                { property: 'margin-left',
+                  values: [ value(0, undefined, 'add', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1,   '30px', 'replace') ] } ]
+  },
   { desc:     'a missing property in final keyframe',
     frames:   [ { margin: '5px' },
                 { } ],
     expected: [ { property: 'margin-top',
                   values: [ value(0, '5px', 'replace', 'linear'),
                             value(1, undefined, 'add') ] },
                 { property: 'margin-right',
                   values: [ value(0, '5px', 'replace', 'linear'),
                             value(1, undefined, 'add') ] },
                 { property: 'margin-bottom',
                   values: [ value(0, '5px', 'replace', 'linear'),
                             value(1, undefined, 'add') ] },
                 { property: 'margin-left',
                   values: [ value(0, '5px', 'replace', 'linear'),
                             value(1, undefined, 'add') ] } ]
   },
+  { desc:     'a missing property in final keyframe and there are some ' +
+              'keyframes with the same offsets',
+    frames:   [ { margin: '5px' },
+                { margin: '10px', offset: 0.5 },
+                { margin: '20px', offset: 0.5 },
+                { } ],
+    expected: [ { property: 'margin-top',
+                  values: [ value(0,   '5px', 'replace', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1,   undefined, 'add') ] },
+                { property: 'margin-right',
+                  values: [ value(0, '5px', 'replace', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1, undefined, 'add') ] },
+                { property: 'margin-bottom',
+                  values: [ value(0, '5px', 'replace', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1, undefined, 'add') ] },
+                { property: 'margin-left',
+                  values: [ value(0, '5px', 'replace', 'linear'),
+                            value(0.5, '10px', 'replace'),
+                            value(0.5, '20px', 'replace', 'linear'),
+                            value(1, undefined, 'add') ] } ]
+  },
   { desc:     'a missing property in final keyframe where it forms the last'
               + ' segment in the series',
     frames:   [ { margin: '5px' },
                 { marginLeft: '5px',
                   marginRight: '5px',
                   marginBottom: '5px' } ],
     expected: [ { property: 'margin-bottom',
                   values: [ value(0, '5px', 'replace', 'linear'),