Bug 1141710, part 5 - Change from assert_true() to the new assert_unreached(). r=dholbert
☠☠ backed out by 24872a839d9d ☠ ☠
authorJonathan Watt <jwatt@jwatt.org>
Mon, 02 Mar 2015 20:05:03 +0000
changeset 232910 0bf9f153d5bc21cd8ea1f72f845c5171361bde42
parent 232909 ac29161a0f983b37088f6e86a9933652089e6e75
child 232911 e1330135150d1d502d83ef79de95e1ac18a235e5
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 5 - Change from assert_true() to the new assert_unreached(). 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
@@ -69,17 +69,17 @@ const END_POSITION = 200;
  *     makeSomeChanges();
  *     return eventWatcher.waitForEvent(nextEventType);
  *   }).then(function() {
  *     // Promise fulfilled
  *     checkMoreStuff();
  *     eventWatcher.stopWatching(); // all done - stop listening for events
  *   });
  *
- * This class will assert_true(false) if an event occurs when there is no
+ * This class will assert_unreached() if an event occurs when there is no
  * Promise created by a waitForEvent() call waiting to be fulfilled, or if the
  * event is of a different type to the type passed to waitForEvent. This helps
  * provide test coverage to ensure that only events that are expected occur, in
  * the correct order and with the correct timing. It also helps vastly simplify
  * the already complex code below by avoiding lots of gnarly error handling
  * code.
  */
 function EventWatcher(watchedNode, eventTypes)
@@ -87,23 +87,23 @@ function EventWatcher(watchedNode, event
   if (typeof eventTypes == 'string') {
     eventTypes = [eventTypes];
   }
 
   var waitingFor = null;
 
   function eventHandler(evt) {
     if (!waitingFor) {
-      assert_true(false, 'Not expecting event, but got: ' + evt.type +
+      assert_unreached('Not expecting event, but got: ' + evt.type +
         ' targeting element #' + evt.target.getAttribute('id'));
       return;
     }
     if (evt.type != waitingFor.types[0]) {
-      assert_true(false, 'Expected ' + waitingFor.types[0] + ' event but got ' +
-                         evt.type + ' event');
+      assert_unreached('Expected ' + waitingFor.types[0] + ' event but got ' +
+                        evt.type + ' event');
       return;
     }
     if (waitingFor.types.length > 1) {
       // Pop first event from array
       waitingFor.types.shift();
       return;
     }
     // We need to null out waitingFor before calling the resolve function since
@@ -338,17 +338,17 @@ async_test(function(t) {
 
     player.startTime = document.timeline.currentTime - ANIM_DELAY_MS - ANIM_DUR_MS; // end of active interval
     return eventWatcher.waitForEvent('animationend');
   })).then(t.step_func(function() {
     checkStateAtActiveIntervalEndTime(player);
 
     eventWatcher.stopWatching();
   })).catch(t.step_func(function(reason) {
-    assert_true(false, reason);
+    assert_unreached(reason);
   })).then(function() {
     t.done();
   });
 }, 'Skipping forward through animation');
 
 
 async_test(function(t) {
   var div = addDiv(t, {'class': 'animated-div'});
@@ -389,17 +389,17 @@ async_test(function(t) {
     // the animation start time, we now expect an animationend event
     // because we went from inside to outside the active interval.
     return eventWatcher.waitForEvent('animationend');
   })).then(t.step_func(function() {
     checkStateOnReadyPromiseResolved(player);
 
     eventWatcher.stopWatching();
   })).catch(t.step_func(function(reason) {
-    assert_true(false, reason);
+    assert_unreached(reason);
   })).then(function() {
     t.done();
   });
 
   // This must come after we've set up the Promise chain, since requesting
   // computed style will force events to be dispatched.
   // XXX For some reason this fails occasionally (either the player.playState
   // check or the marginLeft check).
@@ -494,17 +494,17 @@ async_test(function(t) {
   div.style.animation = 'anim ' + ANIM_DUR_MS + 'ms ' + ANIM_DELAY_MS + 'ms';
 
   var player = div.getAnimationPlayers()[0];
 
   player.ready.then(t.step_func(function() {
     player.startTime = null;
     return player.ready;
   })).catch(t.step_func(function(reason) {
-    assert_true(false, reason);
+    assert_unreached(reason);
   })).then(function() {
     t.done();
   });
 }, 'Setting startTime to null');
 
 
 async_test(function(t) {
   var div = addDiv(t, {'class': 'animated-div'});
@@ -519,17 +519,17 @@ async_test(function(t) {
       'AnimationPlayer.startTime not null on ready Promise resolve');
 
     player.pause();
     assert_equals(player.startTime, null,
       'AnimationPlayer.startTime is null after paused');
     assert_equals(player.playState, 'paused',
       'AnimationPlayer.playState is "paused" after pause() call');
   })).catch(t.step_func(function(reason) {
-    assert_true(false, reason);
+    assert_unreached(reason);
   })).then(function() {
     t.done();
   });
 }, 'AnimationPlayer.startTime after paused');
 
     </script>
   </body>
 </html>