Tests that an AnimatorSet can be correctly canceled during the delay of one of
its children
yAnim.setStartDelay(500);
final AnimatorSet animSet = new AnimatorSet();
animSet.playSequentially(xAnim, yAnim);
mFutureListener = new FutureReleaseListener(mFuture);
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
try {
Handler handler = new Handler();
animSet.addListener(mFutureListener);
mRunning = true;
animSet.start();
handler.postDelayed(new Canceler(animSet, mFuture), ANIM_DURATION + 250);
} catch (junit.framework.AssertionFailedError e) {
mFuture.setException(new RuntimeException(e));
}
}
});
mFuture.get(getTimeout(), TimeUnit.MILLISECONDS);