Bug 1415010 - Use arrow functions. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 07 Nov 2017 10:30:07 +0900
changeset 693894 667f91789c4c6a65ec8f81d24e56dc39af27a784
parent 693840 6b89155dd988772b27d81881a89f28a7cbb2a2ec
child 693895 b4503a0d919760b16f6dcc9a40739571d3f24636
push id87963
push userhikezoe@mozilla.com
push dateTue, 07 Nov 2017 01:31:18 +0000
reviewersbirtles
bugs1415010
milestone58.0a1
Bug 1415010 - Use arrow functions. r?birtles MozReview-Commit-ID: D6gL50giYkO
dom/animation/test/css-animations/file_event-order.html
--- a/dom/animation/test/css-animations/file_event-order.html
+++ b/dom/animation/test/css-animations/file_event-order.html
@@ -50,108 +50,108 @@ function setupAnimation(t, animationStyl
     };
   });
 
   const animation = div.getAnimations()[0];
 
   return [animation, watcher, div];
 }
 
-promise_test(function(t) {
+promise_test(t => {
   let events = [];
   const [animation1, watcher1, div1] =
     setupAnimation(t, 'anim 100s 2 paused', events);
   const [animation2, watcher2, div2] =
     setupAnimation(t, 'anim 100s 2 paused', events);
 
   return Promise.all([ watcher1.wait_for('animationstart'),
-                       watcher2.wait_for('animationstart') ]).then(function() {
+                       watcher2.wait_for('animationstart') ]).then(() => {
     checkEvents(events, ['animationstart', div1, 0],
                         ['animationstart', div2, 0]);
 
     events.length = 0;  // Clear received event array
 
     animation1.currentTime = 100 * MS_PER_SEC;
     animation2.currentTime = 100 * MS_PER_SEC;
     return Promise.all([ watcher1.wait_for('animationiteration'),
                          watcher2.wait_for('animationiteration') ]);
-  }).then(function() {
+  }).then(() => {
     checkEvents(events, ['animationiteration', div1, 100],
                         ['animationiteration', div2, 100]);
 
     events.length = 0;  // Clear received event array
 
     animation1.finish();
     animation2.finish();
 
     return Promise.all([ watcher1.wait_for('animationend'),
                          watcher2.wait_for('animationend') ]);
-  }).then(function() {
+  }).then(() => {
     checkEvents(events, ['animationend', div1, 200],
                         ['animationend', div2, 200]);
   });
 }, 'Test same events are ordered by elements.');
 
-promise_test(function(t) {
+promise_test(t => {
   let events = [];
   const [animation1, watcher1, div1] =
     setupAnimation(t, 'anim 200s 400s', events);
   const [animation2, watcher2, div2] =
     setupAnimation(t, 'anim 300s 2', events);
 
-  return watcher2.wait_for('animationstart').then(function(evt) {
+  return watcher2.wait_for('animationstart').then(evt => {
     animation1.currentTime = 400 * MS_PER_SEC;
     animation2.currentTime = 400 * MS_PER_SEC;
 
     events.length = 0;  // Clear received event array
 
     return Promise.all([ watcher1.wait_for('animationstart'),
                          watcher2.wait_for('animationiteration') ]);
-  }).then(function() {
+  }).then(() => {
     checkEvents(events, ['animationiteration', div2, 300],
                         ['animationstart',     div1, 0]);
   });
 }, 'Test start and iteration events are ordered by time.');
 
-promise_test(function(t) {
+promise_test(t => {
   let events = [];
   const [animation1, watcher1, div1] =
     setupAnimation(t, 'anim 150s', events);
   const [animation2, watcher2, div2] =
     setupAnimation(t, 'anim 100s 2', events);
 
   return Promise.all([ watcher1.wait_for('animationstart'),
-                       watcher2.wait_for('animationstart') ]).then(function() {
+                       watcher2.wait_for('animationstart') ]).then(() => {
     animation1.currentTime = 150 * MS_PER_SEC;
     animation2.currentTime = 150 * MS_PER_SEC;
 
     events.length = 0;  // Clear received event array
 
     return Promise.all([ watcher1.wait_for('animationend'),
                          watcher2.wait_for('animationiteration') ]);
-  }).then(function() {
+  }).then(() => {
     checkEvents(events, ['animationiteration', div2, 100],
                         ['animationend',       div1, 150]);
   });
 }, 'Test iteration and end events are ordered by time.');
 
-promise_test(function(t) {
+promise_test(t => {
   let events = [];
   const [animation1, watcher1, div1] =
     setupAnimation(t, 'anim 100s 100s', events);
   const [animation2, watcher2, div2] =
     setupAnimation(t, 'anim 100s 2', events);
 
   animation1.finish();
   animation2.finish();
 
   return Promise.all([ watcher1.wait_for([ 'animationstart',
                                            'animationend' ]),
                        watcher2.wait_for([ 'animationstart',
-                                           'animationend' ]) ]).then(function() {
+                                           'animationend' ]) ]).then(() => {
     checkEvents(events, ['animationstart', div2, 0],
                         ['animationstart', div1, 0],
                         ['animationend',   div1, 100],
                         ['animationend',   div2, 200]);
   });
 }, 'Test start and end events are sorted correctly when fired simultaneously');
 
 done();