blob: b0739f4972af835348ad4fb9ef9c60028550ced6 [file] [log] [blame]
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.app.cts;
import dalvik.annotation.BrokenTest;
import dalvik.annotation.TestLevel;
import dalvik.annotation.TestTargetClass;
import dalvik.annotation.TestTargetNew;
import dalvik.annotation.TestTargets;
import android.app.ActivityGroup;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
@TestTargetClass(ActivityGroup.class)
public class ActivityGroupTest extends ActivityTestsBase {
private Intent mTabIntent;
@Override
protected void setUp() throws Exception {
super.setUp();
mTabIntent = new Intent(mContext, LaunchpadTabActivity.class);
mTabIntent.putExtra("tab", new ComponentName(mContext, LaunchpadActivity.class));
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {boolean.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onCreate",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onResume",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onSaveInstanceState",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onPause",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onStop",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onDestroy",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCurrentActivity",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getLocalActivityManager",
args = {}
)
})
public void testTabBasic() throws Exception {
mIntent = mTabIntent;
runLaunchpad(LaunchpadActivity.LIFECYCLE_BASIC);
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {boolean.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onCreate",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onResume",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onSaveInstanceState",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onPause",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onStop",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onDestroy",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCurrentActivity",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getLocalActivityManager",
args = {}
)
})
@BrokenTest(value="bug 2189784, needs investigation")
public void testTabScreen() throws Exception {
mIntent = mTabIntent;
runMultipleLaunchpads("testTabScreen", getClass(),
LaunchpadActivity.LIFECYCLE_SCREEN_ON_STOP,
LaunchpadActivity.LIFECYCLE_SCREEN_ON_RESUME);
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {boolean.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onCreate",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onResume",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onSaveInstanceState",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onPause",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onStop",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onDestroy",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCurrentActivity",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getLocalActivityManager",
args = {}
)
})
@BrokenTest(value="bug 2189784, needs investigation")
public void testTabDialog() throws Exception {
mIntent = mTabIntent;
runMultipleLaunchpads("testTabDialog", getClass(),
LaunchpadActivity.LIFECYCLE_DIALOG_ON_RESUME,
LaunchpadActivity.LIFECYCLE_DIALOG_ON_STOP);
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {boolean.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onCreate",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onResume",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onSaveInstanceState",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onPause",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onStop",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onDestroy",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCurrentActivity",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getLocalActivityManager",
args = {}
)
})
public void testTabFinishCreate() throws Exception {
mIntent = mTabIntent;
runLaunchpad(LaunchpadActivity.LIFECYCLE_FINISH_CREATE);
}
@TestTargets({
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "ActivityGroup",
args = {boolean.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onCreate",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onResume",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onSaveInstanceState",
args = {Bundle.class}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onPause",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onStop",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "onDestroy",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getCurrentActivity",
args = {}
),
@TestTargetNew(
level = TestLevel.COMPLETE,
notes = "",
method = "getLocalActivityManager",
args = {}
)
})
public void testTabFinishStart() throws Exception {
mIntent = mTabIntent;
runLaunchpad(LaunchpadActivity.LIFECYCLE_FINISH_START);
}
}