summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-04-18 07:41:45 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-18 07:41:45 -0700
commit3d100d97a55c5aba2cac5599a158fe3759d278ca (patch)
treed895a448ea83f93d77a13014be9f7c060d4e63ce /core/tests
parentb9a6d4d052a7cc63b4753081f64628be3503681a (diff)
parent17cf42cb85c22b50ecfa8d21efc992f99d20fc45 (diff)
downloadframeworks_base-3d100d97a55c5aba2cac5599a158fe3759d278ca.zip
frameworks_base-3d100d97a55c5aba2cac5599a158fe3759d278ca.tar.gz
frameworks_base-3d100d97a55c5aba2cac5599a158fe3759d278ca.tar.bz2
Merge "Fix logic of animator start/cancel/end callbacks"
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/animation/EventsTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/tests/coretests/src/android/animation/EventsTest.java b/core/tests/coretests/src/android/animation/EventsTest.java
index 701a3f0..8df711b 100644
--- a/core/tests/coretests/src/android/animation/EventsTest.java
+++ b/core/tests/coretests/src/android/animation/EventsTest.java
@@ -173,8 +173,7 @@ public abstract class EventsTest
// This should only be called on an animation that has been started and not
// yet canceled or ended
assertFalse(mCanceled);
- assertTrue(mRunning);
- assertTrue(mStarted);
+ assertTrue(mRunning || mStarted);
mCanceled = true;
}
@@ -182,8 +181,7 @@ public abstract class EventsTest
public void onAnimationEnd(Animator animation) {
// This should only be called on an animation that has been started and not
// yet ended
- assertTrue(mRunning);
- assertTrue(mStarted);
+ assertTrue(mRunning || mStarted);
mRunning = false;
mStarted = false;
super.onAnimationEnd(animation);
@@ -210,11 +208,12 @@ public abstract class EventsTest
}
/**
- * Verify that calling end on an unstarted animator does nothing.
+ * Verify that calling end on an unstarted animator starts/ends an animator.
*/
@UiThreadTest
@SmallTest
public void testEnd() throws Exception {
+ mRunning = true; // end() implicitly starts an unstarted animator
mAnimator.end();
}
@@ -496,6 +495,7 @@ public abstract class EventsTest
mRunning = true;
mAnimator.start();
mAnimator.end();
+ mRunning = true; // end() implicitly starts an unstarted animator
mAnimator.end();
mFuture.release();
} catch (junit.framework.AssertionFailedError e) {
@@ -544,6 +544,7 @@ public abstract class EventsTest
mRunning = true;
mAnimator.start();
mAnimator.end();
+ mRunning = true; // end() implicitly starts an unstarted animator
mAnimator.end();
mFuture.release();
} catch (junit.framework.AssertionFailedError e) {