1/*
2 * Copyright (C) 2007 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.widget.layout.linear;
18
19import android.app.Activity;
20import android.test.ActivityInstrumentationTestCase;
21import android.test.suitebuilder.annotation.MediumTest;
22import android.view.View;
23
24import com.android.frameworks.coretests.R;
25
26public class FillInWrapTest extends ActivityInstrumentationTestCase<FillInWrap> {
27    private View mChild;
28    private View mContainer;
29
30    public FillInWrapTest() {
31        super("com.android.frameworks.coretests", FillInWrap.class);
32    }
33
34    @Override
35    protected void setUp() throws Exception {
36        super.setUp();
37
38        final Activity activity = getActivity();
39        mChild = activity.findViewById(R.id.data);
40        mContainer = activity.findViewById(R.id.layout);
41    }
42
43    @MediumTest
44    public void testPreconditions() {
45        assertNotNull(mChild);
46        assertNotNull(mContainer);
47    }
48
49    @MediumTest
50    public void testLayout() {
51        assertTrue("the child's height should be less than the parent's",
52                mChild.getMeasuredHeight() < mContainer.getMeasuredHeight());
53    }
54}
55