Bug 1141710, part 3 - Stop using ECMAScript 6 features in test_animation-player-starttime.html, since other browsers don't support them. r=dholbert
☠☠ backed out by 24872a839d9d ☠ ☠
authorJonathan Watt <jwatt@jwatt.org>
Mon, 02 Mar 2015 20:05:00 +0000
changeset 232908 ee29275a17480cf47c6b702f5b10144be4c2013c
parent 232907 255c9236bb3771a7565652767465001bc9cb8180
child 232909 ac29161a0f983b37088f6e86a9933652089e6e75
push id56680
push userjwatt@jwatt.org
push dateWed, 11 Mar 2015 00:34:08 +0000
treeherdermozilla-inbound@0e360d3f690b [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) {