Testing initial value for 0-duration animations
To ensure consistency with the pre-N animation behavior, we are testing the following: - For animations that have a duration of 0, we set the animator's value to the end value when start() is called. - For animations with a duration > 0 but with the duration scale of 0 applied, we set the animator's value to its start value when start() gets called. Change-Id: I666105e0677c6cfdeddb11b483d71dab978adc11
This commit is contained in:
@@ -900,6 +900,10 @@ public class ValueAnimatorTests extends ActivityInstrumentationTestCase2<BasicAn
|
||||
a1.start();
|
||||
a2.reverse();
|
||||
a3.start();
|
||||
// Check that the animators' values are immediately set to end value in the case of
|
||||
// 0-duration.
|
||||
assertEquals(A1_END_VALUE, a1.getAnimatedValue());
|
||||
assertEquals(A2_START_VALUE, a2.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
Thread.sleep(POLL_INTERVAL);
|
||||
@@ -946,6 +950,10 @@ public class ValueAnimatorTests extends ActivityInstrumentationTestCase2<BasicAn
|
||||
|
||||
a1.start();
|
||||
a2.start();
|
||||
|
||||
// In the case of 0 duration scale applied to a non-0 duration, check that the
|
||||
// value is immediately set to the start value.
|
||||
assertEquals(A2_START_VALUE, a2.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
Thread.sleep(POLL_INTERVAL);
|
||||
@@ -957,6 +965,8 @@ public class ValueAnimatorTests extends ActivityInstrumentationTestCase2<BasicAn
|
||||
assertTrue(l2.startCalled);
|
||||
assertTrue(l1.endCalled);
|
||||
assertTrue(l2.endCalled);
|
||||
assertEquals(A1_END_VALUE, a1.getAnimatedValue());
|
||||
assertEquals(A2_END_VALUE, a2.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user