Bug 1264125 part 9 - Rename variable name of CSS-Transition tests. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 20 Dec 2016 16:40:30 +0900
changeset 451406 adf15b34fe32ec2f274e41a213543886d87243a3
parent 451405 0e0e67dffdd2957abcc64c55b46e1ff573cabc7b
child 540006 61dad24d3bf44de48d385d4741ba7f50c88a18a0
push id39155
push usermantaroh@gmail.com
push dateTue, 20 Dec 2016 07:41:01 +0000
reviewersbirtles
bugs1264125
milestone53.0a1
Bug 1264125 part 9 - Rename variable name of CSS-Transition tests. r?birtles MozReview-Commit-ID: 2ulhgG4aBQs
dom/animation/test/css-transitions/file_animation-cancel.html
--- a/dom/animation/test/css-transitions/file_animation-cancel.html
+++ b/dom/animation/test/css-transitions/file_animation-cancel.html
@@ -7,227 +7,227 @@
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(waitForFrame).then(function() {
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(waitForFrame).then(function() {
     assert_not_equals(getComputedStyle(div).marginLeft, '1000px',
                       'transform style is animated before cancelling');
-    animation.cancel();
+    transition.cancel();
     assert_equals(getComputedStyle(div).marginLeft, div.style.marginLeft,
                   'transform style is no longer animated after cancelling');
   });
 }, 'Animated style is cleared after cancelling a running CSS transition');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    animation.cancel();
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    transition.cancel();
     assert_equals(getComputedStyle(div).marginLeft, '1000px',
                   'margin-left style is not animated after cancelling');
-    animation.play();
+    transition.play();
     assert_equals(getComputedStyle(div).marginLeft, '0px',
                   'margin-left style is animated after re-starting transition');
-    return animation.ready;
+    return transition.ready;
   }).then(function() {
-    assert_equals(animation.playState, 'running',
+    assert_equals(transition.playState, 'running',
                   'Transition succeeds in running after being re-started');
   });
 }, 'After canceling a transition, it can still be re-used');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    animation.finish();
-    animation.cancel();
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    transition.finish();
+    transition.cancel();
     assert_equals(getComputedStyle(div).marginLeft, '1000px',
                   'margin-left style is not animated after cancelling');
-    animation.play();
+    transition.play();
     assert_equals(getComputedStyle(div).marginLeft, '0px',
                   'margin-left style is animated after re-starting transition');
-    return animation.ready;
+    return transition.ready;
   }).then(function() {
-    assert_equals(animation.playState, 'running',
+    assert_equals(transition.playState, 'running',
                   'Transition succeeds in running after being re-started');
   });
 }, 'After cancelling a finished transition, it can still be re-used');
 
 test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  animation.cancel();
+  var transition = div.getAnimations()[0];
+  transition.cancel();
   assert_equals(getComputedStyle(div).marginLeft, '1000px',
                 'margin-left style is not animated after cancelling');
 
   // Trigger a change to a transition property and check that this
   // doesn't cause the animation to become live again
   div.style.transitionDuration = '200s';
   flushComputedStyle(div);
   assert_equals(getComputedStyle(div).marginLeft, '1000px',
                 'margin-left style is still not animated after updating'
                 + ' transition-duration');
-  assert_equals(animation.playState, 'idle',
+  assert_equals(transition.playState, 'idle',
                 'Transition is still idle after updating transition-duration');
 }, 'After cancelling a transition, updating transition properties doesn\'t make'
    + ' it live again');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     div.style.display = 'none';
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
     assert_equals(getComputedStyle(div).marginLeft, '1000px');
   });
 }, 'Setting display:none on an element cancels its transitions');
 
 promise_test(function(t) {
   var parentDiv = addDiv(t);
   var childDiv = document.createElement('div');
   parentDiv.appendChild(childDiv);
   childDiv.setAttribute('style', 'margin-left: 0px');
 
   flushComputedStyle(childDiv);
 
   childDiv.style.transition = 'margin-left 100s';
   childDiv.style.marginLeft = '1000px';
 
-  var animation = childDiv.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = childDiv.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     parentDiv.style.display = 'none';
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
     assert_equals(getComputedStyle(childDiv).marginLeft, '1000px');
   });
 }, 'Setting display:none cancels transitions on a child element');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     // Set an unrecognized property value
     div.style.transitionProperty = 'none';
     flushComputedStyle(div);
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
     assert_equals(getComputedStyle(div).marginLeft, '1000px');
   });
 }, 'Removing a property from transition-property cancels transitions on that '+
    'property');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     div.style.transition = 'margin-top 10s -10s'; // combined duration is zero
     flushComputedStyle(div);
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
     assert_equals(getComputedStyle(div).marginLeft, '1000px');
   });
 }, 'Setting zero combined duration');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     div.style.marginLeft = '2000px';
     flushComputedStyle(div);
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
   });
 }, 'Changing style to another interpolable value cancels the original ' +
    'transition');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     div.style.marginLeft = 'auto';
     flushComputedStyle(div);
     return waitForFrame();
   }).then(function() {
     assert_equals(div.getAnimations().length, 0,
                   'There should be no transitions');
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
   });
 }, 'An after-change style value can\'t be interpolated');
 
 promise_test(function(t) {
   var div = addDiv(t, { style: 'margin-left: 0px' });
   flushComputedStyle(div);
 
   div.style.transition = 'margin-left 100s';
   div.style.marginLeft = '1000px';
 
-  var animation = div.getAnimations()[0];
-  return animation.ready.then(function() {
-    assert_equals(animation.playState, 'running');
+  var transition = div.getAnimations()[0];
+  return transition.ready.then(function() {
+    assert_equals(transition.playState, 'running');
     div.style.marginLeft = '0px';
     flushComputedStyle(div);
     return waitForFrame();
   }).then(function() {
-    assert_equals(animation.playState, 'idle');
+    assert_equals(transition.playState, 'idle');
   });
 }, 'Reversing a running transition cancels the original transition');
 
 done();
 </script>
 </body>