1/*
2 * Copyright (C) 2014 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 */
16package android.uirendering.cts.testclasses;
17
18import android.graphics.Color;
19import android.graphics.Rect;
20import android.support.test.filters.MediumTest;
21import android.support.test.runner.AndroidJUnit4;
22import android.uirendering.cts.R;
23import android.uirendering.cts.bitmapverifiers.ColorVerifier;
24import android.uirendering.cts.bitmapverifiers.RectVerifier;
25import android.uirendering.cts.testinfrastructure.ActivityTestBase;
26
27import org.junit.Test;
28import org.junit.runner.RunWith;
29
30@MediumTest
31@RunWith(AndroidJUnit4.class)
32public class LayoutTests extends ActivityTestBase {
33    @Test
34    public void testSimpleRedLayout() {
35        createTest().addLayout(R.layout.simple_red_layout, null, false).runWithVerifier(
36                new ColorVerifier(Color.RED));
37    }
38
39    @Test
40    public void testSimpleRectLayout() {
41        createTest().addLayout(R.layout.simple_rect_layout, null, false).runWithVerifier(
42                new RectVerifier(Color.WHITE, Color.BLUE, new Rect(5, 5, 85, 85)));
43    }
44}
45
46