Bug 1141710, part 3 - Stop using ECMAScript 6 features in test_animation-player-starttime.html, since other browsers don't support them. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Wed, 04 Mar 2015 02:49:43 +0000
changeset 232957 3427f7cbfc35d7b34884090755ea33ee4721771b
parent 232956 263431cbffb7ac4d4defed71566bd4446dd4788f
child 232958 b7c05cadcbe65bafa931a0cd86d73d0a154559b4
push id28396
push usercbook@mozilla.com
push dateWed, 11 Mar 2015 11:49:38 +0000
treeherdermozilla-central@b574129dcac0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1141710
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1141710, part 3 - Stop using ECMAScript 6 features in test_animation-player-starttime.html, since other browsers don't support them. r=dholbert
dom/animation/test/css-animations/test_animation-player-starttime.html
--- a/dom/animation/test/css-animations/test_animation-player-starttime.html
+++ b/dom/animation/test/css-animations/test_animation-player-starttime.html
@@ -18,17 +18,17 @@
 
     </style>
     <script src="/resources/testharness.js"></script>
     <script src="/resources/testharnessreport.js"></script>
     <script src="../testcommon.js"></script>
   </head>
   <body>
     <div id="log"></div>
-    <script type="text/javascript;version=1.8">
+    <script type="text/javascript">
 
 'use strict';
 
 // TODO: add equivalent tests without an animation-delay, but first we need to
 // change the timing of animationstart dispatch. (Right now the animationstart
 // event will fire before the ready Promise is resolved if there is no
 // animation-delay.)
 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1134163
@@ -109,18 +109,18 @@ function EventWatcher(watchedNode, event
     // We need to null out waitingFor before calling the resolve function since
     // the Promise's resolve handlers may call waitForEvent() which will need
     // to set waitingFor.
     var resolveFunc = waitingFor.resolve;
     waitingFor = null;
     resolveFunc(evt);
   }
 
-  for (let event of eventTypes) {
-    watchedNode.addEventListener(event, eventHandler);
+  for (var i = 0; i < eventTypes.length; i++) {
+    watchedNode.addEventListener(eventTypes[i], eventHandler);
   }
 
   this.waitForEvent = function(type) {
     if (typeof type != 'string') {
       return Promise.reject('Event type not a string');
     }
     return this.waitForEvents([type]);
   };
@@ -149,18 +149,18 @@ function EventWatcher(watchedNode, event
         types: types,
         resolve: resolve,
         reject: reject
       };
     });
   };
 
   this.stopWatching = function() {
-    for (let event of eventTypes) {
-      watchedNode.removeEventListener(event, eventHandler);
+    for (var i = 0; i < eventTypes.length; i++) {
+      watchedNode.removeEventListener(eventTypes[i], eventHandler);
     }
   };
 
   return this;
 }
 
 // The terms used for the naming of the following helper functions refer to
 // terms used in the Web Animations specification for specific phases of an
@@ -426,17 +426,17 @@ async_test(function(t) {
 //
 // We do all these tests in a single async_test since that allows us to share
 // the timeout that we use to wait so that this test file isn't delayed by the
 // timeout time multiplied by number of tests.
 async_test(function(t) {
   var divs = new Array(6);
   var eventWatchers = new Array(6);
   var players = new Array(6);
-  for (let i = 0; i < 6; i++) {
+  for (var i = 0; i < 6; i++) {
     divs[i] = addDiv(t, {'class': 'animated-div'});
     eventWatchers[i] = new EventWatcher(divs[i], CSS_ANIM_EVENTS);
     divs[i].style.animation = 'anim ' + ANIM_DUR_MS + 'ms ' + ANIM_DELAY_MS + 'ms';
     players[i] = divs[i].getAnimationPlayers()[0];
   }
 
   var beforeTime = document.timeline.currentTime - ANIM_DELAY_MS / 2;
   var activeTime = document.timeline.currentTime - ANIM_DELAY_MS - ANIM_DUR_MS / 2;
@@ -476,17 +476,17 @@ async_test(function(t) {
     players[5].startTime = activeTime;
     players[5].startTime = afterTime;
   });
   players[5].startTime = afterTime; // get us into the initial state
 
   // See the long comment documenting this async_test for an explanation of
   // why we have this timeout and its relationship to intermittent failure.
   setTimeout(function() {
-    for (let i = 0; i < 6; i++) {
+    for (var i = 0; i < 6; i++) {
       eventWatchers[i].stopWatching();
     }
     t.done();
   }, 1000);
 }, 'Redundant changes');
 
 
 async_test(function(t) {