Home | History | Annotate | Download | only in cts
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 package android.animation.cts;
     17 
     18 import android.animation.AnimatorListenerAdapter;
     19 import android.support.test.filters.SmallTest;
     20 import android.support.test.runner.AndroidJUnit4;
     21 
     22 import org.junit.Test;
     23 import org.junit.runner.RunWith;
     24 
     25 @SmallTest
     26 @RunWith(AndroidJUnit4.class)
     27 public class AnimatorListenerAdapterTest {
     28     /**
     29      * AnimatorListenerAdapter has a noop implementation of the AnimatorListener interface.
     30      * It should do nothing, including when nulls are passed to it.
     31      * <p>
     32      * Mostly this test pokes the implementation so that it is counted as tested. There isn't
     33      * much to test here since it has no implementation.
     34      */
     35     @Test
     36     public void testNullOk() {
     37         AnimatorListenerAdapter adapter = new MyAdapter();
     38         adapter.onAnimationStart(null);
     39         adapter.onAnimationEnd(null);
     40         adapter.onAnimationRepeat(null);
     41         adapter.onAnimationCancel(null);
     42         adapter.onAnimationPause(null);
     43         adapter.onAnimationResume(null);
     44     }
     45 
     46     private static class MyAdapter extends AnimatorListenerAdapter {
     47     }
     48 }
     49