1/*
2 * Copyright (C) 2006 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.app.activity;
18
19import android.content.ComponentName;
20import android.test.suitebuilder.annotation.LargeTest;
21import android.test.suitebuilder.annotation.Suppress;
22
23@Suppress  // Flaky.
24public class LaunchTest extends ActivityTestsBase {
25
26    @LargeTest
27    public void testColdActivity() throws Exception {
28        mIntent.putExtra("component", new ComponentName(getContext(), TestedActivity.class));
29        runLaunchpad(LaunchpadActivity.LAUNCH);
30    }
31
32    @LargeTest
33    public void testLocalActivity() throws Exception {
34        mIntent.putExtra("component", new ComponentName(getContext(), LocalActivity.class));
35        runLaunchpad(LaunchpadActivity.LAUNCH);
36    }
37
38    @LargeTest
39    public void testColdScreen() throws Exception {
40        mIntent.putExtra("component", new ComponentName(getContext(), TestedScreen.class));
41        runLaunchpad(LaunchpadActivity.LAUNCH);
42    }
43
44    @LargeTest
45    public void testLocalScreen() throws Exception {
46        mIntent.putExtra("component", new ComponentName(getContext(), LocalScreen.class));
47        runLaunchpad(LaunchpadActivity.LAUNCH);
48    }
49
50    @LargeTest
51    public void testForwardResult() throws Exception {
52        runLaunchpad(LaunchpadActivity.FORWARD_RESULT);
53    }
54
55    // The following is disabled until we can catch and recover from
56    // application errors.
57    public void xxtestBadParcelable() throws Exception {
58        // All we really care about for this test is that the system
59        // doesn't crash.
60        runLaunchpad(LaunchpadActivity.BAD_PARCELABLE);
61    }
62
63    @LargeTest
64    public void testClearTopInCreate() throws Exception {
65        mIntent.putExtra("component", new ComponentName(getContext(), ClearTop.class));
66        runLaunchpad(LaunchpadActivity.LAUNCH);
67    }
68
69    @LargeTest
70    public void testClearTopWhileResumed() throws Exception {
71        mIntent.putExtra("component", new ComponentName(getContext(), ClearTop.class));
72        mIntent.putExtra(ClearTop.WAIT_CLEAR_TASK, true);
73        runLaunchpad(LaunchpadActivity.LAUNCH);
74    }
75}
76
77
78