Bug 1424949 - Use assert_greater_than or assert_less_than in file_animations-dynamic-changes.html. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 15 Dec 2017 01:24:57 +0900
changeset 711798 5cf3b4424741e8e8e580113a54bbaf8e08dc4848
parent 711742 23038e9bc3f7f480845b91839629c4bde387d2b4
child 711799 ab857d2350aa72afe02bb86d6c8e2e514b854cf4
push id93148
push userhikezoe@mozilla.com
push dateThu, 14 Dec 2017 17:56:27 +0000
reviewersbirtles
bugs1424949
milestone59.0a1
Bug 1424949 - Use assert_greater_than or assert_less_than in file_animations-dynamic-changes.html. r?birtles MozReview-Commit-ID: I24yopOv51d
dom/animation/test/css-animations/file_animations-dynamic-changes.html
--- a/dom/animation/test/css-animations/file_animations-dynamic-changes.html
+++ b/dom/animation/test/css-animations/file_animations-dynamic-changes.html
@@ -84,18 +84,18 @@ promise_test(function(t) {
                   'First Animation is in second position after update');
     assert_equals(animations[2], animation2,
                   'Second Animation is in third position after update');
     assert_equals(animations[1].startTime, animations[2].startTime,
                   'Old Animations have the same start time');
     // TODO: Check that animations[0].startTime === null
     return animations[0].ready;
   }).then(function() {
-    assert_true(animations[0].startTime > animations[1].startTime,
-                'New Animation has later start time');
+    assert_greater_than(animations[0].startTime, animations[1].startTime,
+                        'New Animation has later start time');
   });
 }, 'Only the startTimes of existing animations are preserved');
 
 promise_test(function(t) {
   var div = addDiv(t);
   div.style.animation = 'anim1 100s, anim1 100s';
   var secondAnimation = div.getAnimations()[1];
 
@@ -104,18 +104,19 @@ promise_test(function(t) {
     // Trim list of animations
     div.style.animationName = 'anim1';
     var animations = div.getAnimations();
     assert_equals(animations.length, 1, 'List of Animations was trimmed');
     assert_equals(animations[0], secondAnimation,
                   'Remaining Animation is the second one in the list');
     assert_equals(typeof(animations[0].startTime), 'number',
                   'Remaining Animation has resolved startTime');
-    assert_true(animations[0].startTime < animations[0].timeline.currentTime,
-                'Remaining Animation preserves startTime');
+    assert_less_than(animations[0].startTime,
+                     animations[0].timeline.currentTime,
+                     'Remaining Animation preserves startTime');
   });
 }, 'Animations are removed from the start of the list while preserving'
    + ' the state of existing Animations');
 
 promise_test(function(t) {
   var div = addDiv(t);
   div.style.animation = 'anim1 100s';
   var firstAddedAnimation = div.getAnimations()[0],
@@ -137,18 +138,19 @@ promise_test(function(t) {
     assert_equals(animations[0], secondAddedAnimation,
                   'Second Animation remains in same position after'
                   + ' interleaving');
     assert_equals(animations[2], firstAddedAnimation,
                   'First Animation remains in same position after'
                   + ' interleaving');
     return animations[1].ready;
   }).then(function() {
-    assert_true(animations[1].startTime > animations[0].startTime,
-                'Interleaved animation starts later than existing animations');
-    assert_true(animations[0].startTime > animations[2].startTime,
-                'Original animations retain their start time');
+    assert_greater_than(animations[1].startTime, animations[0].startTime,
+                        'Interleaved animation starts later than existing ' +
+                        'animations');
+    assert_greater_than(animations[0].startTime, animations[2].startTime,
+                        'Original animations retain their start time');
   });
 }, 'Animation state is preserved when interleaving animations in list');
 
 done();
 </script>
 </body>