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
17package android.uirendering.cts.testclasses;
18
19import android.support.test.filters.MediumTest;
20import android.support.test.runner.AndroidJUnit4;
21import android.uirendering.cts.R;
22import android.uirendering.cts.bitmapcomparers.MSSIMComparer;
23import android.uirendering.cts.bitmapverifiers.GoldenImageVerifier;
24import android.uirendering.cts.testinfrastructure.ActivityTestBase;
25import android.uirendering.cts.testinfrastructure.ViewInitializer;
26import android.view.ViewAnimationUtils;
27
28import org.junit.Test;
29import org.junit.runner.RunWith;
30
31@MediumTest
32@RunWith(AndroidJUnit4.class)
33public class ViewAnimationUtilsTests extends ActivityTestBase {
34    @Test
35    public void testCreateCircularReveal() {
36        createTest()
37                .addLayout(R.layout.blue_padded_layout, (ViewInitializer) view -> {
38                    ViewAnimationUtils.createCircularReveal(view, 45, 45, 45, 45)
39                            .setDuration(10000) // 10 sec, longer than animation
40                            .start();
41                }, true)
42                .runWithVerifier(new GoldenImageVerifier(getActivity(),
43                        R.drawable.golden_blue_circle, new MSSIMComparer(0.99)));
44    }
45}
46