Merge "Frameworks core tests size cleanup." into gingerbread

This commit is contained in:
Brett Chabot
2010-08-03 16:02:09 -07:00
committed by Android (Google) Code Review
25 changed files with 239 additions and 291 deletions

View File

@@ -18,10 +18,7 @@ package android.app.activity;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
import android.test.FlakyTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.Suppress; import android.test.suitebuilder.annotation.Suppress;
public class LifecycleTest extends ActivityTestsBase { public class LifecycleTest extends ActivityTestsBase {
@@ -37,7 +34,7 @@ public class LifecycleTest extends ActivityTestsBase {
LaunchpadActivity.class)); LaunchpadActivity.class));
} }
@LargeTest @MediumTest
public void testBasic() throws Exception { public void testBasic() throws Exception {
mIntent = mTopIntent; mIntent = mTopIntent;
runLaunchpad(LaunchpadActivity.LIFECYCLE_BASIC); runLaunchpad(LaunchpadActivity.LIFECYCLE_BASIC);

View File

@@ -27,7 +27,6 @@ import android.content.res.TypedArray;
import android.content.res.XmlResourceParser; import android.content.res.XmlResourceParser;
import android.os.Bundle; import android.os.Bundle;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import com.android.frameworks.coretests.R; import com.android.frameworks.coretests.R;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
@@ -134,7 +133,7 @@ public class MetaDataTest extends AndroidTestCase {
assertNull("Meta data returned when not requested", si.metaData); assertNull("Meta data returned when not requested", si.metaData);
} }
@MediumTest @SmallTest
public void testProviderWithData() throws Exception { public void testProviderWithData() throws Exception {
ComponentName cn = new ComponentName(mContext, LocalProvider.class); ComponentName cn = new ComponentName(mContext, LocalProvider.class);
ProviderInfo pi = mContext.getPackageManager().resolveContentProvider( ProviderInfo pi = mContext.getPackageManager().resolveContentProvider(

View File

@@ -16,13 +16,12 @@
package android.content; package android.content;
import android.content.Intent;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest;
/** Test to make sure brick intents <b>don't</b> work without permission. */ /** Test to make sure brick intents <b>don't</b> work without permission. */
public class BrickDeniedTest extends AndroidTestCase { public class BrickDeniedTest extends AndroidTestCase {
@MediumTest @SmallTest
public void testBrick() { public void testBrick() {
// Try both the old and new brick intent names. Neither should work, // Try both the old and new brick intent names. Neither should work,
// since this test application doesn't have the required permission. // since this test application doesn't have the required permission.

View File

@@ -16,10 +16,11 @@
package android.content; package android.content;
import android.content.ContentResolver;
import android.net.Uri; import android.net.Uri;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import java.io.InputStream; import java.io.InputStream;
import java.util.Arrays; import java.util.Arrays;
@@ -46,7 +47,7 @@ public class MemoryFileProviderTest extends AndroidTestCase {
} }
// tests that we don't leak file descriptors or virtual address space // tests that we don't leak file descriptors or virtual address space
@MediumTest @LargeTest
public void testClose() throws Exception { public void testClose() throws Exception {
ContentResolver resolver = getContext().getContentResolver(); ContentResolver resolver = getContext().getContentResolver();
// open enough file descriptors that we will crash something if we leak FDs // open enough file descriptors that we will crash something if we leak FDs
@@ -65,7 +66,7 @@ public class MemoryFileProviderTest extends AndroidTestCase {
} }
// tests that we haven't broken AssestFileDescriptors for normal files. // tests that we haven't broken AssestFileDescriptors for normal files.
@MediumTest @SmallTest
public void testFile() throws Exception { public void testFile() throws Exception {
ContentResolver resolver = getContext().getContentResolver(); ContentResolver resolver = getContext().getContentResolver();
Uri uri = Uri.parse("content://android.content.MemoryFileProvider/file"); Uri uri = Uri.parse("content://android.content.MemoryFileProvider/file");

View File

@@ -18,17 +18,19 @@ package android.content;
import com.android.internal.os.AtomicFile; import com.android.internal.os.AtomicFile;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.mock.MockContext;
import android.test.mock.MockContentResolver;
import android.accounts.Account; import android.accounts.Account;
import android.os.Bundle; import android.os.Bundle;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;
import android.test.mock.MockContentResolver;
import android.test.mock.MockContext;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import java.util.List;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.util.List;
public class SyncStorageEngineTest extends AndroidTestCase { public class SyncStorageEngineTest extends AndroidTestCase {
@@ -57,7 +59,7 @@ public class SyncStorageEngineTest extends AndroidTestCase {
/** /**
* Test that we can create, remove and retrieve periodic syncs * Test that we can create, remove and retrieve periodic syncs
*/ */
@SmallTest @MediumTest
public void testPeriodics() throws Exception { public void testPeriodics() throws Exception {
final Account account1 = new Account("a@example.com", "example.type"); final Account account1 = new Account("a@example.com", "example.type");
final Account account2 = new Account("b@example.com", "example.type.2"); final Account account2 = new Account("b@example.com", "example.type.2");
@@ -114,7 +116,7 @@ public class SyncStorageEngineTest extends AndroidTestCase {
} }
} }
@SmallTest @LargeTest
public void testAuthorityPersistence() throws Exception { public void testAuthorityPersistence() throws Exception {
final Account account1 = new Account("a@example.com", "example.type"); final Account account1 = new Account("a@example.com", "example.type");
final Account account2 = new Account("b@example.com", "example.type.2"); final Account account2 = new Account("b@example.com", "example.type.2");
@@ -197,7 +199,7 @@ public class SyncStorageEngineTest extends AndroidTestCase {
assertEquals(0, engine.getIsSyncable(account2, authority2)); assertEquals(0, engine.getIsSyncable(account2, authority2));
} }
@SmallTest @MediumTest
public void testAuthorityParsing() throws Exception { public void testAuthorityParsing() throws Exception {
final Account account = new Account("account1", "type1"); final Account account = new Account("account1", "type1");
final String authority1 = "auth1"; final String authority1 = "auth1";
@@ -299,7 +301,7 @@ public class SyncStorageEngineTest extends AndroidTestCase {
assertEquals(sync3s, syncs.get(0)); assertEquals(sync3s, syncs.get(0));
} }
@SmallTest @MediumTest
public void testAuthorityRenaming() throws Exception { public void testAuthorityRenaming() throws Exception {
final Account account1 = new Account("acc1", "type1"); final Account account1 = new Account("acc1", "type1");
final Account account2 = new Account("acc2", "type2"); final Account account2 = new Account("acc2", "type2");

View File

@@ -16,32 +16,25 @@
package android.content.pm; package android.content.pm;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.pm.ApplicationInfo; import android.os.RemoteException;
import android.content.pm.IPackageDataObserver; import android.os.ServiceManager;
import android.content.pm.IPackageStatsObserver; import android.os.StatFs;
import android.content.pm.PackageStats;
import android.content.pm.IPackageManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.Suppress;
import android.util.Log; import android.util.Log;
import android.os.Handler;
import android.os.RemoteException; import java.io.File;
import android.os.ServiceManager; import java.io.FileInputStream;
import android.os.StatFs; import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
public class AppCacheTest extends AndroidTestCase { public class AppCacheTest extends AndroidTestCase {
private static final boolean localLOGV = false; private static final boolean localLOGV = false;
@@ -627,7 +620,8 @@ public class AppCacheTest extends AndroidTestCase {
} }
} }
@SmallTest // TODO: flaky test, omit from LargeTest for now
//@LargeTest
public void testFreeStorage() throws Exception { public void testFreeStorage() throws Exception {
boolean TRACKING = true; boolean TRACKING = true;
StatFs st = new StatFs("/data"); StatFs st = new StatFs("/data");

View File

@@ -16,6 +16,11 @@
package android.content.pm; package android.content.pm;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static android.content.pm.PackageManager.GET_DISABLED_COMPONENTS;
import com.android.frameworks.coretests.enabled_app.DisabledActivity; import com.android.frameworks.coretests.enabled_app.DisabledActivity;
import com.android.frameworks.coretests.enabled_app.DisabledProvider; import com.android.frameworks.coretests.enabled_app.DisabledProvider;
import com.android.frameworks.coretests.enabled_app.DisabledReceiver; import com.android.frameworks.coretests.enabled_app.DisabledReceiver;
@@ -27,21 +32,9 @@ import com.android.frameworks.coretests.enabled_app.EnabledService;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.test.AndroidTestCase;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
import static android.content.pm.PackageManager.GET_DISABLED_COMPONENTS;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.test.AndroidTestCase;
import java.util.List; import java.util.List;
@@ -134,7 +127,7 @@ public class ComponentTest extends AndroidTestCase {
assertNotNull(mContext); assertNotNull(mContext);
} }
@MediumTest @SmallTest
public void testResolveDisabledActivity() throws Exception { public void testResolveDisabledActivity() throws Exception {
mPackageManager.setComponentEnabledSetting(DISABLED_ACTIVITY_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(DISABLED_ACTIVITY_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -150,7 +143,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info2.activityInfo.enabled); assertFalse(info2.activityInfo.enabled);
} }
@MediumTest @SmallTest
public void testResolveEnabledActivity() throws Exception { public void testResolveEnabledActivity() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -183,7 +176,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info.activityInfo.enabled); assertFalse(info.activityInfo.enabled);
} }
@MediumTest @SmallTest
public void testQueryEnabledActivity() throws Exception { public void testQueryEnabledActivity() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -218,7 +211,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(activityInfo.enabled); assertFalse(activityInfo.enabled);
} }
@MediumTest @SmallTest
public void testGetEnabledActivityInfo() throws Exception { public void testGetEnabledActivityInfo() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -253,7 +246,7 @@ public class ComponentTest extends AndroidTestCase {
assertEquals(1, infoList.size()); assertEquals(1, infoList.size());
} }
@LargeTest @MediumTest
public void testDisableActivity() throws Exception { public void testDisableActivity() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_ACTIVITY_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -281,7 +274,7 @@ public class ComponentTest extends AndroidTestCase {
assertEquals(0, infoList.size()); assertEquals(0, infoList.size());
} }
@MediumTest @SmallTest
public void testResolveDisabledService() throws Exception { public void testResolveDisabledService() throws Exception {
mPackageManager.setComponentEnabledSetting(DISABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(DISABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -297,7 +290,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info2.serviceInfo.enabled); assertFalse(info2.serviceInfo.enabled);
} }
@MediumTest @SmallTest
public void testResolveEnabledService() throws Exception { public void testResolveEnabledService() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -310,7 +303,7 @@ public class ComponentTest extends AndroidTestCase {
assertTrue(info.serviceInfo.enabled); assertTrue(info.serviceInfo.enabled);
} }
@MediumTest @SmallTest
public void testQueryDisabledService() throws Exception { public void testQueryDisabledService() throws Exception {
mPackageManager.setComponentEnabledSetting(DISABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(DISABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -330,7 +323,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info.serviceInfo.enabled); assertFalse(info.serviceInfo.enabled);
} }
@MediumTest @SmallTest
public void testQueryEnabledService() throws Exception { public void testQueryEnabledService() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -365,7 +358,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(serviceInfo.enabled); assertFalse(serviceInfo.enabled);
} }
@MediumTest @SmallTest
public void testGetEnabledServiceInfo() throws Exception { public void testGetEnabledServiceInfo() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -396,7 +389,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info2.serviceInfo.enabled); assertFalse(info2.serviceInfo.enabled);
} }
@LargeTest @MediumTest
public void testDisableService() throws Exception { public void testDisableService() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_SERVICE_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -420,7 +413,7 @@ public class ComponentTest extends AndroidTestCase {
assertTrue(info3.serviceInfo.enabled); assertTrue(info3.serviceInfo.enabled);
} }
@MediumTest @SmallTest
public void testQueryDisabledReceiver() throws Exception { public void testQueryDisabledReceiver() throws Exception {
mPackageManager.setComponentEnabledSetting(DISABLED_RECEIVER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(DISABLED_RECEIVER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -440,7 +433,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(info.activityInfo.enabled); assertFalse(info.activityInfo.enabled);
} }
@MediumTest @SmallTest
public void testQueryEnabledReceiver() throws Exception { public void testQueryEnabledReceiver() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_RECEIVER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_RECEIVER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -475,7 +468,7 @@ public class ComponentTest extends AndroidTestCase {
assertFalse(activityInfo.enabled); assertFalse(activityInfo.enabled);
} }
@MediumTest @SmallTest
public void testGetEnabledReceiverInfo() throws Exception { public void testGetEnabledReceiverInfo() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_RECEIVER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_RECEIVER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -530,7 +523,7 @@ public class ComponentTest extends AndroidTestCase {
} }
} }
@MediumTest @SmallTest
public void testResolveEnabledProvider() throws Exception { public void testResolveEnabledProvider() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_PROVIDER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_PROVIDER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -542,7 +535,7 @@ public class ComponentTest extends AndroidTestCase {
assertTrue(providerInfo.enabled); assertTrue(providerInfo.enabled);
} }
@MediumTest @SmallTest
public void testResolveDisabledProvider() throws Exception { public void testResolveDisabledProvider() throws Exception {
mPackageManager.setComponentEnabledSetting(DISABLED_PROVIDER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(DISABLED_PROVIDER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,
@@ -594,7 +587,7 @@ public class ComponentTest extends AndroidTestCase {
assertNull(providerInfo2); assertNull(providerInfo2);
} }
@MediumTest @SmallTest
public void testQueryEnabledProvider() throws Exception { public void testQueryEnabledProvider() throws Exception {
mPackageManager.setComponentEnabledSetting(ENABLED_PROVIDER_COMPONENTNAME, mPackageManager.setComponentEnabledSetting(ENABLED_PROVIDER_COMPONENTNAME,
COMPONENT_ENABLED_STATE_DEFAULT, COMPONENT_ENABLED_STATE_DEFAULT,

View File

@@ -23,22 +23,10 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageMoveObserver;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageParser;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources; import android.content.res.Resources;
import android.content.res.Resources.NotFoundException; import android.content.res.Resources.NotFoundException;
import android.net.Uri; import android.net.Uri;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.Suppress;
import android.util.DisplayMetrics;
import android.util.Log;
import android.os.Environment; import android.os.Environment;
import android.os.FileUtils; import android.os.FileUtils;
import android.os.IBinder; import android.os.IBinder;
@@ -52,6 +40,7 @@ import android.os.storage.StorageResultCode;
import android.provider.Settings; import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException; import android.provider.Settings.SettingNotFoundException;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
@@ -575,17 +564,17 @@ public class PackageManagerTests extends AndroidTestCase {
return ip; return ip;
} }
@MediumTest @LargeTest
public void testInstallNormalInternal() { public void testInstallNormalInternal() {
sampleInstallFromRawResource(0, true); sampleInstallFromRawResource(0, true);
} }
@MediumTest @LargeTest
public void testInstallFwdLockedInternal() { public void testInstallFwdLockedInternal() {
sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, true); sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, true);
} }
@MediumTest @LargeTest
public void testInstallSdcard() { public void testInstallSdcard() {
sampleInstallFromRawResource(PackageManager.INSTALL_EXTERNAL, true); sampleInstallFromRawResource(PackageManager.INSTALL_EXTERNAL, true);
} }
@@ -675,33 +664,33 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
@MediumTest @LargeTest
public void testReplaceFailNormalInternal() { public void testReplaceFailNormalInternal() {
sampleReplaceFromRawResource(0); sampleReplaceFromRawResource(0);
} }
@MediumTest @LargeTest
public void testReplaceFailFwdLockedInternal() { public void testReplaceFailFwdLockedInternal() {
sampleReplaceFromRawResource(PackageManager.INSTALL_FORWARD_LOCK); sampleReplaceFromRawResource(PackageManager.INSTALL_FORWARD_LOCK);
} }
@MediumTest @LargeTest
public void testReplaceFailSdcard() { public void testReplaceFailSdcard() {
sampleReplaceFromRawResource(PackageManager.INSTALL_EXTERNAL); sampleReplaceFromRawResource(PackageManager.INSTALL_EXTERNAL);
} }
@MediumTest @LargeTest
public void testReplaceNormalInternal() { public void testReplaceNormalInternal() {
sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING); sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING);
} }
@MediumTest @LargeTest
public void testReplaceFwdLockedInternal() { public void testReplaceFwdLockedInternal() {
sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING | sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING |
PackageManager.INSTALL_FORWARD_LOCK); PackageManager.INSTALL_FORWARD_LOCK);
} }
@MediumTest @LargeTest
public void testReplaceSdcard() { public void testReplaceSdcard() {
sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING | sampleReplaceFromRawResource(PackageManager.INSTALL_REPLACE_EXISTING |
PackageManager.INSTALL_EXTERNAL); PackageManager.INSTALL_EXTERNAL);
@@ -815,32 +804,32 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
@MediumTest @LargeTest
public void testDeleteNormalInternal() { public void testDeleteNormalInternal() {
deleteFromRawResource(0, 0); deleteFromRawResource(0, 0);
} }
@MediumTest @LargeTest
public void testDeleteFwdLockedInternal() { public void testDeleteFwdLockedInternal() {
deleteFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, 0); deleteFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, 0);
} }
@MediumTest @LargeTest
public void testDeleteSdcard() { public void testDeleteSdcard() {
deleteFromRawResource(PackageManager.INSTALL_EXTERNAL, 0); deleteFromRawResource(PackageManager.INSTALL_EXTERNAL, 0);
} }
@MediumTest @LargeTest
public void testDeleteNormalInternalRetainData() { public void testDeleteNormalInternalRetainData() {
deleteFromRawResource(0, PackageManager.DONT_DELETE_DATA); deleteFromRawResource(0, PackageManager.DONT_DELETE_DATA);
} }
@MediumTest @LargeTest
public void testDeleteFwdLockedInternalRetainData() { public void testDeleteFwdLockedInternalRetainData() {
deleteFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, PackageManager.DONT_DELETE_DATA); deleteFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, PackageManager.DONT_DELETE_DATA);
} }
@MediumTest @LargeTest
public void testDeleteSdcardRetainData() { public void testDeleteSdcardRetainData() {
deleteFromRawResource(PackageManager.INSTALL_EXTERNAL, PackageManager.DONT_DELETE_DATA); deleteFromRawResource(PackageManager.INSTALL_EXTERNAL, PackageManager.DONT_DELETE_DATA);
} }
@@ -1040,7 +1029,7 @@ public class PackageManagerTests extends AndroidTestCase {
* (Use PackageManagerService private api for now) * (Use PackageManagerService private api for now)
* Make sure the installed package is available. * Make sure the installed package is available.
*/ */
@MediumTest @LargeTest
public void testMountSdNormalInternal() { public void testMountSdNormalInternal() {
assertTrue(mountFromRawResource()); assertTrue(mountFromRawResource());
} }
@@ -1071,31 +1060,31 @@ public class PackageManagerTests extends AndroidTestCase {
} catch (NameNotFoundException e) {} } catch (NameNotFoundException e) {}
} }
@MediumTest @LargeTest
public void testManifestInstallLocationInternal() { public void testManifestInstallLocationInternal() {
installFromRawResource("install.apk", R.raw.install_loc_internal, installFromRawResource("install.apk", R.raw.install_loc_internal,
0, true, false, -1, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); 0, true, false, -1, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testManifestInstallLocationSdcard() { public void testManifestInstallLocationSdcard() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
0, true, false, -1, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); 0, true, false, -1, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testManifestInstallLocationAuto() { public void testManifestInstallLocationAuto() {
installFromRawResource("install.apk", R.raw.install_loc_auto, installFromRawResource("install.apk", R.raw.install_loc_auto,
0, true, false, -1, PackageInfo.INSTALL_LOCATION_AUTO); 0, true, false, -1, PackageInfo.INSTALL_LOCATION_AUTO);
} }
@MediumTest @LargeTest
public void testManifestInstallLocationUnspecified() { public void testManifestInstallLocationUnspecified() {
installFromRawResource("install.apk", R.raw.install_loc_unspecified, installFromRawResource("install.apk", R.raw.install_loc_unspecified,
0, true, false, -1, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); 0, true, false, -1, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testManifestInstallLocationFwdLockedFlagSdcard() { public void testManifestInstallLocationFwdLockedFlagSdcard() {
installFromRawResource("install.apk", R.raw.install_loc_unspecified, installFromRawResource("install.apk", R.raw.install_loc_unspecified,
PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_FORWARD_LOCK |
@@ -1104,7 +1093,7 @@ public class PackageManagerTests extends AndroidTestCase {
PackageInfo.INSTALL_LOCATION_UNSPECIFIED); PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testManifestInstallLocationFwdLockedSdcard() { public void testManifestInstallLocationFwdLockedSdcard() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
PackageManager.INSTALL_FORWARD_LOCK, true, false, PackageManager.INSTALL_FORWARD_LOCK, true, false,
@@ -1117,7 +1106,7 @@ public class PackageManagerTests extends AndroidTestCase {
* the package via flag to install on sdcard. Make sure the new flag overrides * the package via flag to install on sdcard. Make sure the new flag overrides
* the old install location. * the old install location.
*/ */
@MediumTest @LargeTest
public void testReplaceFlagInternalSdcard() { public void testReplaceFlagInternalSdcard() {
int iFlags = 0; int iFlags = 0;
int rFlags = PackageManager.INSTALL_EXTERNAL; int rFlags = PackageManager.INSTALL_EXTERNAL;
@@ -1139,7 +1128,7 @@ public class PackageManagerTests extends AndroidTestCase {
* the package with no flags or manifest option and make sure the old * the package with no flags or manifest option and make sure the old
* install location is retained. * install location is retained.
*/ */
@MediumTest @LargeTest
public void testReplaceFlagSdcardInternal() { public void testReplaceFlagSdcardInternal() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = 0; int rFlags = 0;
@@ -1156,7 +1145,7 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
@MediumTest @LargeTest
public void testManifestInstallLocationReplaceInternalSdcard() { public void testManifestInstallLocationReplaceInternalSdcard() {
int iFlags = 0; int iFlags = 0;
int iApk = R.raw.install_loc_internal; int iApk = R.raw.install_loc_internal;
@@ -1179,7 +1168,7 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
@MediumTest @LargeTest
public void testManifestInstallLocationReplaceSdcardInternal() { public void testManifestInstallLocationReplaceSdcardInternal() {
int iFlags = 0; int iFlags = 0;
int iApk = R.raw.install_loc_sdcard; int iApk = R.raw.install_loc_sdcard;
@@ -1401,7 +1390,7 @@ public class PackageManagerTests extends AndroidTestCase {
fail, result); fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppInternalToExternal() { public void testMoveAppInternalToExternal() {
int installFlags = PackageManager.INSTALL_INTERNAL; int installFlags = PackageManager.INSTALL_INTERNAL;
int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA; int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA;
@@ -1410,7 +1399,7 @@ public class PackageManagerTests extends AndroidTestCase {
sampleMoveFromRawResource(installFlags, moveFlags, fail, result); sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppInternalToInternal() { public void testMoveAppInternalToInternal() {
int installFlags = PackageManager.INSTALL_INTERNAL; int installFlags = PackageManager.INSTALL_INTERNAL;
int moveFlags = PackageManager.MOVE_INTERNAL; int moveFlags = PackageManager.MOVE_INTERNAL;
@@ -1419,7 +1408,7 @@ public class PackageManagerTests extends AndroidTestCase {
sampleMoveFromRawResource(installFlags, moveFlags, fail, result); sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppExternalToExternal() { public void testMoveAppExternalToExternal() {
int installFlags = PackageManager.INSTALL_EXTERNAL; int installFlags = PackageManager.INSTALL_EXTERNAL;
int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA; int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA;
@@ -1427,7 +1416,7 @@ public class PackageManagerTests extends AndroidTestCase {
int result = PackageManager.MOVE_FAILED_INVALID_LOCATION; int result = PackageManager.MOVE_FAILED_INVALID_LOCATION;
sampleMoveFromRawResource(installFlags, moveFlags, fail, result); sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppExternalToInternal() { public void testMoveAppExternalToInternal() {
int installFlags = PackageManager.INSTALL_EXTERNAL; int installFlags = PackageManager.INSTALL_EXTERNAL;
int moveFlags = PackageManager.MOVE_INTERNAL; int moveFlags = PackageManager.MOVE_INTERNAL;
@@ -1435,7 +1424,7 @@ public class PackageManagerTests extends AndroidTestCase {
int result = PackageManager.MOVE_SUCCEEDED; int result = PackageManager.MOVE_SUCCEEDED;
sampleMoveFromRawResource(installFlags, moveFlags, fail, result); sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppForwardLocked() { public void testMoveAppForwardLocked() {
int installFlags = PackageManager.INSTALL_FORWARD_LOCK; int installFlags = PackageManager.INSTALL_FORWARD_LOCK;
int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA; int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA;
@@ -1443,7 +1432,7 @@ public class PackageManagerTests extends AndroidTestCase {
int result = PackageManager.MOVE_FAILED_FORWARD_LOCKED; int result = PackageManager.MOVE_FAILED_FORWARD_LOCKED;
sampleMoveFromRawResource(installFlags, moveFlags, fail, result); sampleMoveFromRawResource(installFlags, moveFlags, fail, result);
} }
@MediumTest @LargeTest
public void testMoveAppFailInternalToExternalDelete() { public void testMoveAppFailInternalToExternalDelete() {
int installFlags = 0; int installFlags = 0;
int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA; int moveFlags = PackageManager.MOVE_EXTERNAL_MEDIA;
@@ -1477,7 +1466,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an install error code is returned when media is unmounted * Test that an install error code is returned when media is unmounted
* and package installed on sdcard via package manager flag. * and package installed on sdcard via package manager flag.
*/ */
@MediumTest @LargeTest
public void testInstallSdcardUnmount() { public void testInstallSdcardUnmount() {
boolean origState = getMediaState(); boolean origState = getMediaState();
try { try {
@@ -1502,7 +1491,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Unmount sdcard. Try installing an app with manifest option to install * Unmount sdcard. Try installing an app with manifest option to install
* on sdcard. Make sure it gets installed on internal flash. * on sdcard. Make sure it gets installed on internal flash.
*/ */
@MediumTest @LargeTest
public void testInstallManifestSdcardUnmount() { public void testInstallManifestSdcardUnmount() {
boolean origState = getMediaState(); boolean origState = getMediaState();
try { try {
@@ -1534,14 +1523,14 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Install an app on internal flash * Install an app on internal flash
*/ */
@MediumTest @LargeTest
public void testFlagI() { public void testFlagI() {
sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, true); sampleInstallFromRawResource(PackageManager.INSTALL_INTERNAL, true);
} }
/* /*
* Install an app on sdcard. * Install an app on sdcard.
*/ */
@MediumTest @LargeTest
public void testFlagE() { public void testFlagE() {
sampleInstallFromRawResource(PackageManager.INSTALL_EXTERNAL, true); sampleInstallFromRawResource(PackageManager.INSTALL_EXTERNAL, true);
} }
@@ -1549,14 +1538,14 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Install an app on sdcard. * Install an app on sdcard.
*/ */
@MediumTest @LargeTest
public void testFlagF() { public void testFlagF() {
sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, true); sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK, true);
} }
/* /*
* Install an app with both internal and external flags set. should fail * Install an app with both internal and external flags set. should fail
*/ */
@MediumTest @LargeTest
public void testFlagIE() { public void testFlagIE() {
installFromRawResource("install.apk", R.raw.install, installFromRawResource("install.apk", R.raw.install,
PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_INTERNAL, PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_INTERNAL,
@@ -1568,7 +1557,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Install an app with both internal and external flags set. should fail * Install an app with both internal and external flags set. should fail
*/ */
@MediumTest @LargeTest
public void testFlagIF() { public void testFlagIF() {
sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK | sampleInstallFromRawResource(PackageManager.INSTALL_FORWARD_LOCK |
PackageManager.INSTALL_INTERNAL, true); PackageManager.INSTALL_INTERNAL, true);
@@ -1576,7 +1565,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Install an app with both internal and external flags set. should fail * Install an app with both internal and external flags set. should fail
*/ */
@MediumTest @LargeTest
public void testFlagEF() { public void testFlagEF() {
installFromRawResource("install.apk", R.raw.install, installFromRawResource("install.apk", R.raw.install,
PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_EXTERNAL,
@@ -1587,7 +1576,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Install an app with both internal and external flags set. should fail * Install an app with both internal and external flags set. should fail
*/ */
@MediumTest @LargeTest
public void testFlagIEF() { public void testFlagIEF() {
installFromRawResource("install.apk", R.raw.install, installFromRawResource("install.apk", R.raw.install,
PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_INTERNAL | PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_INTERNAL |
@@ -1600,7 +1589,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both internal and manifest option set. * Install an app with both internal and manifest option set.
* should install on internal. * should install on internal.
*/ */
@MediumTest @LargeTest
public void testFlagIManifestI() { public void testFlagIManifestI() {
installFromRawResource("install.apk", R.raw.install_loc_internal, installFromRawResource("install.apk", R.raw.install_loc_internal,
PackageManager.INSTALL_INTERNAL, PackageManager.INSTALL_INTERNAL,
@@ -1612,7 +1601,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both internal and manifest preference for * Install an app with both internal and manifest preference for
* preferExternal. Should install on internal. * preferExternal. Should install on internal.
*/ */
@MediumTest @LargeTest
public void testFlagIManifestE() { public void testFlagIManifestE() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
PackageManager.INSTALL_INTERNAL, PackageManager.INSTALL_INTERNAL,
@@ -1624,7 +1613,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both internal and manifest preference for * Install an app with both internal and manifest preference for
* auto. should install internal. * auto. should install internal.
*/ */
@MediumTest @LargeTest
public void testFlagIManifestA() { public void testFlagIManifestA() {
installFromRawResource("install.apk", R.raw.install_loc_auto, installFromRawResource("install.apk", R.raw.install_loc_auto,
PackageManager.INSTALL_INTERNAL, PackageManager.INSTALL_INTERNAL,
@@ -1636,7 +1625,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both external and manifest option set. * Install an app with both external and manifest option set.
* should install externally. * should install externally.
*/ */
@MediumTest @LargeTest
public void testFlagEManifestI() { public void testFlagEManifestI() {
installFromRawResource("install.apk", R.raw.install_loc_internal, installFromRawResource("install.apk", R.raw.install_loc_internal,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1648,7 +1637,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both external and manifest preference for * Install an app with both external and manifest preference for
* preferExternal. Should install externally. * preferExternal. Should install externally.
*/ */
@MediumTest @LargeTest
public void testFlagEManifestE() { public void testFlagEManifestE() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1660,7 +1649,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with both external and manifest preference for * Install an app with both external and manifest preference for
* auto. should install on external media. * auto. should install on external media.
*/ */
@MediumTest @LargeTest
public void testFlagEManifestA() { public void testFlagEManifestA() {
installFromRawResource("install.apk", R.raw.install_loc_auto, installFromRawResource("install.apk", R.raw.install_loc_auto,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1672,7 +1661,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with fwd locked flag set and install location set to * Install an app with fwd locked flag set and install location set to
* internal. should install internally. * internal. should install internally.
*/ */
@MediumTest @LargeTest
public void testFlagFManifestI() { public void testFlagFManifestI() {
installFromRawResource("install.apk", R.raw.install_loc_internal, installFromRawResource("install.apk", R.raw.install_loc_internal,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1684,7 +1673,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with fwd locked flag set and install location set to * Install an app with fwd locked flag set and install location set to
* preferExternal. should install internally. * preferExternal. should install internally.
*/ */
@MediumTest @LargeTest
public void testFlagFManifestE() { public void testFlagFManifestE() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1696,7 +1685,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Install an app with fwd locked flag set and install location set to * Install an app with fwd locked flag set and install location set to
* auto. should install internally. * auto. should install internally.
*/ */
@MediumTest @LargeTest
public void testFlagFManifestA() { public void testFlagFManifestA() {
installFromRawResource("install.apk", R.raw.install_loc_auto, installFromRawResource("install.apk", R.raw.install_loc_auto,
PackageManager.INSTALL_EXTERNAL, PackageManager.INSTALL_EXTERNAL,
@@ -1711,7 +1700,7 @@ public class PackageManagerTests extends AndroidTestCase {
* location should be honoured. * location should be honoured.
* testFlagI/E/F/ExistingI/E - * testFlagI/E/F/ExistingI/E -
*/ */
@MediumTest @LargeTest
public void testFlagIExistingI() { public void testFlagIExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_INTERNAL | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_INTERNAL | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1728,7 +1717,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
-1); -1);
} }
@MediumTest @LargeTest
public void testFlagIExistingE() { public void testFlagIExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_INTERNAL | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_INTERNAL | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1745,7 +1734,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
-1); -1);
} }
@MediumTest @LargeTest
public void testFlagEExistingI() { public void testFlagEExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1762,7 +1751,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
-1); -1);
} }
@MediumTest @LargeTest
public void testFlagEExistingE() { public void testFlagEExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_EXTERNAL | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1779,7 +1768,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
-1); -1);
} }
@MediumTest @LargeTest
public void testFlagFExistingI() { public void testFlagFExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1796,7 +1785,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
-1); -1);
} }
@MediumTest @LargeTest
public void testFlagFExistingE() { public void testFlagFExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_FORWARD_LOCK | PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1820,7 +1809,7 @@ public class PackageManagerTests extends AndroidTestCase {
* public void testManifestI/E/A * public void testManifestI/E/A
* TODO out of memory fall back behaviour. * TODO out of memory fall back behaviour.
*/ */
@MediumTest @LargeTest
public void testManifestI() { public void testManifestI() {
installFromRawResource("install.apk", R.raw.install_loc_internal, installFromRawResource("install.apk", R.raw.install_loc_internal,
0, 0,
@@ -1828,7 +1817,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testManifestE() { public void testManifestE() {
installFromRawResource("install.apk", R.raw.install_loc_sdcard, installFromRawResource("install.apk", R.raw.install_loc_sdcard,
0, 0,
@@ -1836,7 +1825,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testManifestA() { public void testManifestA() {
installFromRawResource("install.apk", R.raw.install_loc_auto, installFromRawResource("install.apk", R.raw.install_loc_auto,
0, 0,
@@ -1851,7 +1840,7 @@ public class PackageManagerTests extends AndroidTestCase {
* TODO add out of memory fall back behaviour. * TODO add out of memory fall back behaviour.
* testManifestI/E/AExistingI/E * testManifestI/E/AExistingI/E
*/ */
@MediumTest @LargeTest
public void testManifestIExistingI() { public void testManifestIExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1868,7 +1857,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testManifestIExistingE() { public void testManifestIExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1885,7 +1874,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testManifestEExistingI() { public void testManifestEExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1902,7 +1891,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testManifestEExistingE() { public void testManifestEExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1919,7 +1908,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testManifestAExistingI() { public void testManifestAExistingI() {
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1936,7 +1925,7 @@ public class PackageManagerTests extends AndroidTestCase {
false, -1, false, -1,
PackageInfo.INSTALL_LOCATION_AUTO); PackageInfo.INSTALL_LOCATION_AUTO);
} }
@MediumTest @LargeTest
public void testManifestAExistingE() { public void testManifestAExistingE() {
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
int rFlags = PackageManager.INSTALL_REPLACE_EXISTING; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING;
@@ -1993,37 +1982,37 @@ public class PackageManagerTests extends AndroidTestCase {
setInstallLoc(origSetting); setInstallLoc(origSetting);
} }
} }
@MediumTest @LargeTest
public void testExistingIUserI() { public void testExistingIUserI() {
int userSetting = PackageHelper.APP_INSTALL_INTERNAL; int userSetting = PackageHelper.APP_INSTALL_INTERNAL;
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testExistingIUserE() { public void testExistingIUserE() {
int userSetting = PackageHelper.APP_INSTALL_EXTERNAL; int userSetting = PackageHelper.APP_INSTALL_EXTERNAL;
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testExistingIUserA() { public void testExistingIUserA() {
int userSetting = PackageHelper.APP_INSTALL_AUTO; int userSetting = PackageHelper.APP_INSTALL_AUTO;
int iFlags = PackageManager.INSTALL_INTERNAL; int iFlags = PackageManager.INSTALL_INTERNAL;
setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY);
} }
@MediumTest @LargeTest
public void testExistingEUserI() { public void testExistingEUserI() {
int userSetting = PackageHelper.APP_INSTALL_INTERNAL; int userSetting = PackageHelper.APP_INSTALL_INTERNAL;
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testExistingEUserE() { public void testExistingEUserE() {
int userSetting = PackageHelper.APP_INSTALL_EXTERNAL; int userSetting = PackageHelper.APP_INSTALL_EXTERNAL;
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL); setExistingXUserX(userSetting, iFlags, PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL);
} }
@MediumTest @LargeTest
public void testExistingEUserA() { public void testExistingEUserA() {
int userSetting = PackageHelper.APP_INSTALL_AUTO; int userSetting = PackageHelper.APP_INSTALL_AUTO;
int iFlags = PackageManager.INSTALL_EXTERNAL; int iFlags = PackageManager.INSTALL_EXTERNAL;
@@ -2066,19 +2055,19 @@ public class PackageManagerTests extends AndroidTestCase {
setInstallLoc(origSetting); setInstallLoc(origSetting);
} }
} }
@MediumTest @LargeTest
public void testUserI() { public void testUserI() {
int userSetting = PackageHelper.APP_INSTALL_INTERNAL; int userSetting = PackageHelper.APP_INSTALL_INTERNAL;
int iloc = getExpectedInstallLocation(userSetting); int iloc = getExpectedInstallLocation(userSetting);
setUserX(true, userSetting, iloc); setUserX(true, userSetting, iloc);
} }
@MediumTest @LargeTest
public void testUserE() { public void testUserE() {
int userSetting = PackageHelper.APP_INSTALL_EXTERNAL; int userSetting = PackageHelper.APP_INSTALL_EXTERNAL;
int iloc = getExpectedInstallLocation(userSetting); int iloc = getExpectedInstallLocation(userSetting);
setUserX(true, userSetting, iloc); setUserX(true, userSetting, iloc);
} }
@MediumTest @LargeTest
public void testUserA() { public void testUserA() {
int userSetting = PackageHelper.APP_INSTALL_AUTO; int userSetting = PackageHelper.APP_INSTALL_AUTO;
int iloc = getExpectedInstallLocation(userSetting); int iloc = getExpectedInstallLocation(userSetting);
@@ -2088,19 +2077,19 @@ public class PackageManagerTests extends AndroidTestCase {
* The following set of tests turn on/off the basic * The following set of tests turn on/off the basic
* user setting for turning on install location. * user setting for turning on install location.
*/ */
@MediumTest @LargeTest
public void testUserPrefOffUserI() { public void testUserPrefOffUserI() {
int userSetting = PackageHelper.APP_INSTALL_INTERNAL; int userSetting = PackageHelper.APP_INSTALL_INTERNAL;
int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
setUserX(false, userSetting, iloc); setUserX(false, userSetting, iloc);
} }
@MediumTest @LargeTest
public void testUserPrefOffUserE() { public void testUserPrefOffUserE() {
int userSetting = PackageHelper.APP_INSTALL_EXTERNAL; int userSetting = PackageHelper.APP_INSTALL_EXTERNAL;
int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
setUserX(false, userSetting, iloc); setUserX(false, userSetting, iloc);
} }
@MediumTest @LargeTest
public void testUserPrefOffA() { public void testUserPrefOffA() {
int userSetting = PackageHelper.APP_INSTALL_AUTO; int userSetting = PackageHelper.APP_INSTALL_AUTO;
int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED; int iloc = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
@@ -2277,7 +2266,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Ensure that permissions are properly declared. * Ensure that permissions are properly declared.
*/ */
@MediumTest @LargeTest
public void testInstallOnSdPermissionsUnmount() { public void testInstallOnSdPermissionsUnmount() {
InstallParams ip = null; InstallParams ip = null;
boolean origMediaState = getMediaState(); boolean origMediaState = getMediaState();
@@ -2309,7 +2298,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Please note that this test is very closely tied to the framework's * Please note that this test is very closely tied to the framework's
* naming convention for secure containers. * naming convention for secure containers.
*/ */
@MediumTest @LargeTest
public void testInstallSdcardStaleContainer() { public void testInstallSdcardStaleContainer() {
boolean origMediaState = getMediaState(); boolean origMediaState = getMediaState();
try { try {
@@ -2351,7 +2340,7 @@ public class PackageManagerTests extends AndroidTestCase {
* The app is then re-installed on internal storage. The sdcard is mounted * The app is then re-installed on internal storage. The sdcard is mounted
* and verified that the re-installation on internal storage takes precedence. * and verified that the re-installation on internal storage takes precedence.
*/ */
@MediumTest @LargeTest
public void testInstallSdcardStaleContainerReinstall() { public void testInstallSdcardStaleContainerReinstall() {
boolean origMediaState = getMediaState(); boolean origMediaState = getMediaState();
try { try {
@@ -2429,7 +2418,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with two certificates can be upgraded by the * Test that an app signed with two certificates can be upgraded by the
* same app signed with two certificates. * same app signed with two certificates.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchAllCerts() { public void testReplaceMatchAllCerts() {
replaceCerts(APP1_CERT1_CERT2, APP1_CERT1_CERT2, true, false, -1); replaceCerts(APP1_CERT1_CERT2, APP1_CERT1_CERT2, true, false, -1);
} }
@@ -2438,7 +2427,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with two certificates cannot be upgraded * Test that an app signed with two certificates cannot be upgraded
* by an app signed with a different certificate. * by an app signed with a different certificate.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchNoCerts1() { public void testReplaceMatchNoCerts1() {
replaceCerts(APP1_CERT1_CERT2, APP1_CERT3, true, true, replaceCerts(APP1_CERT1_CERT2, APP1_CERT3, true, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2447,7 +2436,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with two certificates cannot be upgraded * Test that an app signed with two certificates cannot be upgraded
* by an app signed with a different certificate. * by an app signed with a different certificate.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchNoCerts2() { public void testReplaceMatchNoCerts2() {
replaceCerts(APP1_CERT1_CERT2, APP1_CERT3_CERT4, true, true, replaceCerts(APP1_CERT1_CERT2, APP1_CERT3_CERT4, true, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2456,7 +2445,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with two certificates cannot be upgraded by * Test that an app signed with two certificates cannot be upgraded by
* an app signed with a subset of initial certificates. * an app signed with a subset of initial certificates.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchSomeCerts1() { public void testReplaceMatchSomeCerts1() {
replaceCerts(APP1_CERT1_CERT2, APP1_CERT1, true, true, replaceCerts(APP1_CERT1_CERT2, APP1_CERT1, true, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2465,7 +2454,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with two certificates cannot be upgraded by * Test that an app signed with two certificates cannot be upgraded by
* an app signed with the last certificate. * an app signed with the last certificate.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchSomeCerts2() { public void testReplaceMatchSomeCerts2() {
replaceCerts(APP1_CERT1_CERT2, APP1_CERT2, true, true, replaceCerts(APP1_CERT1_CERT2, APP1_CERT2, true, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2474,7 +2463,7 @@ public class PackageManagerTests extends AndroidTestCase {
* Test that an app signed with a certificate can be upgraded by app * Test that an app signed with a certificate can be upgraded by app
* signed with a superset of certificates. * signed with a superset of certificates.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchMoreCerts() { public void testReplaceMatchMoreCerts() {
replaceCerts(APP1_CERT1, APP1_CERT1_CERT2, true, true, replaceCerts(APP1_CERT1, APP1_CERT1_CERT2, true, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2484,7 +2473,7 @@ public class PackageManagerTests extends AndroidTestCase {
* signed with a superset of certificates. Then verify that the an app * signed with a superset of certificates. Then verify that the an app
* signed with the original set of certs cannot upgrade the new one. * signed with the original set of certs cannot upgrade the new one.
*/ */
@MediumTest @LargeTest
public void testReplaceMatchMoreCertsReplaceSomeCerts() { public void testReplaceMatchMoreCertsReplaceSomeCerts() {
InstallParams ip = replaceCerts(APP1_CERT1, APP1_CERT1_CERT2, false, true, InstallParams ip = replaceCerts(APP1_CERT1, APP1_CERT1_CERT2, false, true,
PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES); PackageManager.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES);
@@ -2508,37 +2497,37 @@ public class PackageManagerTests extends AndroidTestCase {
private void checkSignatures(int apk1, int apk2, int expMatchResult) { private void checkSignatures(int apk1, int apk2, int expMatchResult) {
checkSharedSignatures(apk1, apk2, true, false, -1, expMatchResult); checkSharedSignatures(apk1, apk2, true, false, -1, expMatchResult);
} }
@MediumTest @LargeTest
public void testCheckSignaturesAllMatch() { public void testCheckSignaturesAllMatch() {
int apk1 = APP1_CERT1_CERT2; int apk1 = APP1_CERT1_CERT2;
int apk2 = APP2_CERT1_CERT2; int apk2 = APP2_CERT1_CERT2;
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH);
} }
@MediumTest @LargeTest
public void testCheckSignaturesNoMatch() { public void testCheckSignaturesNoMatch() {
int apk1 = APP1_CERT1; int apk1 = APP1_CERT1;
int apk2 = APP2_CERT2; int apk2 = APP2_CERT2;
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH);
} }
@MediumTest @LargeTest
public void testCheckSignaturesSomeMatch1() { public void testCheckSignaturesSomeMatch1() {
int apk1 = APP1_CERT1_CERT2; int apk1 = APP1_CERT1_CERT2;
int apk2 = APP2_CERT1; int apk2 = APP2_CERT1;
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH);
} }
@MediumTest @LargeTest
public void testCheckSignaturesSomeMatch2() { public void testCheckSignaturesSomeMatch2() {
int apk1 = APP1_CERT1_CERT2; int apk1 = APP1_CERT1_CERT2;
int apk2 = APP2_CERT2; int apk2 = APP2_CERT2;
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH);
} }
@MediumTest @LargeTest
public void testCheckSignaturesMoreMatch() { public void testCheckSignaturesMoreMatch() {
int apk1 = APP1_CERT1; int apk1 = APP1_CERT1;
int apk2 = APP2_CERT1_CERT2; int apk2 = APP2_CERT1_CERT2;
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_NO_MATCH);
} }
@MediumTest @LargeTest
public void testCheckSignaturesUnknown() { public void testCheckSignaturesUnknown() {
int apk1 = APP1_CERT1_CERT2; int apk1 = APP1_CERT1_CERT2;
int apk2 = APP2_CERT1_CERT2; int apk2 = APP2_CERT1_CERT2;
@@ -2567,7 +2556,7 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
} }
@MediumTest @LargeTest
public void testInstallNoCertificates() { public void testInstallNoCertificates() {
int apk1 = APP1_UNSIGNED; int apk1 = APP1_UNSIGNED;
String apk1Name = "install1.apk"; String apk1Name = "install1.apk";
@@ -2620,7 +2609,7 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
} }
@MediumTest @LargeTest
public void testCheckSignaturesSharedAllMatch() { public void testCheckSignaturesSharedAllMatch() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT1_CERT2; int apk2 = SHARED2_CERT1_CERT2;
@@ -2629,7 +2618,7 @@ public class PackageManagerTests extends AndroidTestCase {
int expMatchResult = PackageManager.SIGNATURE_MATCH; int expMatchResult = PackageManager.SIGNATURE_MATCH;
checkSharedSignatures(apk1, apk2, true, fail, retCode, expMatchResult); checkSharedSignatures(apk1, apk2, true, fail, retCode, expMatchResult);
} }
@MediumTest @LargeTest
public void testCheckSignaturesSharedNoMatch() { public void testCheckSignaturesSharedNoMatch() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT2; int apk2 = SHARED2_CERT2;
@@ -2641,7 +2630,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Test that an app signed with cert1 and cert2 cannot be replaced when signed with cert1 alone. * Test that an app signed with cert1 and cert2 cannot be replaced when signed with cert1 alone.
*/ */
@MediumTest @LargeTest
public void testCheckSignaturesSharedSomeMatch1() { public void testCheckSignaturesSharedSomeMatch1() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2653,7 +2642,7 @@ public class PackageManagerTests extends AndroidTestCase {
/* /*
* Test that an app signed with cert1 and cert2 cannot be replaced when signed with cert2 alone. * Test that an app signed with cert1 and cert2 cannot be replaced when signed with cert2 alone.
*/ */
@MediumTest @LargeTest
public void testCheckSignaturesSharedSomeMatch2() { public void testCheckSignaturesSharedSomeMatch2() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT2; int apk2 = SHARED2_CERT2;
@@ -2662,7 +2651,7 @@ public class PackageManagerTests extends AndroidTestCase {
int expMatchResult = -1; int expMatchResult = -1;
checkSharedSignatures(apk1, apk2, true, fail, retCode, expMatchResult); checkSharedSignatures(apk1, apk2, true, fail, retCode, expMatchResult);
} }
@MediumTest @LargeTest
public void testCheckSignaturesSharedUnknown() { public void testCheckSignaturesSharedUnknown() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT1_CERT2; int apk2 = SHARED2_CERT1_CERT2;
@@ -2688,7 +2677,7 @@ public class PackageManagerTests extends AndroidTestCase {
} }
} }
@MediumTest @LargeTest
public void testReplaceFirstSharedMatchAllCerts() { public void testReplaceFirstSharedMatchAllCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2696,7 +2685,7 @@ public class PackageManagerTests extends AndroidTestCase {
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH);
replaceCerts(apk1, rapk1, true, false, -1); replaceCerts(apk1, rapk1, true, false, -1);
} }
@MediumTest @LargeTest
public void testReplaceSecondSharedMatchAllCerts() { public void testReplaceSecondSharedMatchAllCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2704,7 +2693,7 @@ public class PackageManagerTests extends AndroidTestCase {
checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH); checkSignatures(apk1, apk2, PackageManager.SIGNATURE_MATCH);
replaceCerts(apk2, rapk2, true, false, -1); replaceCerts(apk2, rapk2, true, false, -1);
} }
@MediumTest @LargeTest
public void testReplaceFirstSharedMatchSomeCerts() { public void testReplaceFirstSharedMatchSomeCerts() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT1_CERT2; int apk2 = SHARED2_CERT1_CERT2;
@@ -2715,7 +2704,7 @@ public class PackageManagerTests extends AndroidTestCase {
installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true, installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true,
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testReplaceSecondSharedMatchSomeCerts() { public void testReplaceSecondSharedMatchSomeCerts() {
int apk1 = SHARED1_CERT1_CERT2; int apk1 = SHARED1_CERT1_CERT2;
int apk2 = SHARED2_CERT1_CERT2; int apk2 = SHARED2_CERT1_CERT2;
@@ -2726,7 +2715,7 @@ public class PackageManagerTests extends AndroidTestCase {
installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true, installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true,
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testReplaceFirstSharedMatchNoCerts() { public void testReplaceFirstSharedMatchNoCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2737,7 +2726,7 @@ public class PackageManagerTests extends AndroidTestCase {
installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true, installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true,
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testReplaceSecondSharedMatchNoCerts() { public void testReplaceSecondSharedMatchNoCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2748,7 +2737,7 @@ public class PackageManagerTests extends AndroidTestCase {
installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true, installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true,
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testReplaceFirstSharedMatchMoreCerts() { public void testReplaceFirstSharedMatchMoreCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;
@@ -2759,7 +2748,7 @@ public class PackageManagerTests extends AndroidTestCase {
installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true, installFromRawResource("install.apk", rapk1, PackageManager.INSTALL_REPLACE_EXISTING, true,
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
} }
@MediumTest @LargeTest
public void testReplaceSecondSharedMatchMoreCerts() { public void testReplaceSecondSharedMatchMoreCerts() {
int apk1 = SHARED1_CERT1; int apk1 = SHARED1_CERT1;
int apk2 = SHARED2_CERT1; int apk2 = SHARED2_CERT1;

View File

@@ -16,13 +16,14 @@
package android.database.sqlite; package android.database.sqlite;
import android.test.suitebuilder.annotation.LargeTest;
import java.io.File; import java.io.File;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import android.test.suitebuilder.annotation.MediumTest;
/** /**
* Minimal test for JDBC driver * Minimal test for JDBC driver
@@ -62,7 +63,7 @@ public class SQLiteJDBCDriverTest extends AbstractJDBCDriverTest {
// Regression test for (Noser) #255: PreparedStatement.executeUpdate results // Regression test for (Noser) #255: PreparedStatement.executeUpdate results
// in VM crashing with SIGABRT. // in VM crashing with SIGABRT.
@MediumTest @LargeTest
public void test_connection3() throws Exception { public void test_connection3() throws Exception {
PreparedStatement prst = null; PreparedStatement prst = null;
Statement st = null; Statement st = null;

View File

@@ -19,9 +19,8 @@ package android.os;
import com.google.android.collect.Lists; import com.google.android.collect.Lists;
import com.google.android.collect.Maps; import com.google.android.collect.Maps;
import android.os.FileObserver;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest;
import android.util.Log; import android.util.Log;
import java.io.File; import java.io.File;
@@ -69,7 +68,7 @@ public class FileObserverTest extends AndroidTestCase {
} }
} }
@LargeTest @MediumTest
public void testRun() throws Exception { public void testRun() throws Exception {
// make file changes and wait for them // make file changes and wait for them
assertTrue(mTestFile.exists()); assertTrue(mTestFile.exists());

View File

@@ -16,23 +16,15 @@
package android.os; package android.os;
import junit.framework.TestCase;
import android.os.Debug;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log;
import com.android.internal.util.HierarchicalStateMachine;
import com.android.internal.util.HierarchicalState; import com.android.internal.util.HierarchicalState;
import com.android.internal.util.HierarchicalStateMachine;
import com.android.internal.util.ProcessedMessages; import com.android.internal.util.ProcessedMessages;
import java.util.ArrayList; import android.test.suitebuilder.annotation.MediumTest;
import java.util.Arrays; import android.test.suitebuilder.annotation.SmallTest;
import android.util.Log;
import junit.framework.TestCase;
/** /**
* Test for HierarchicalStateMachine. * Test for HierarchicalStateMachine.
@@ -449,7 +441,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private int mExitCount; private int mExitCount;
} }
@SmallTest @MediumTest
public void testStateMachine1() throws Exception { public void testStateMachine1() throws Exception {
StateMachine1 sm1 = new StateMachine1("sm1"); StateMachine1 sm1 = new StateMachine1("sm1");
sm1.start(); sm1.start();
@@ -554,7 +546,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private boolean mDidExit = false; private boolean mDidExit = false;
} }
@SmallTest @MediumTest
public void testStateMachine2() throws Exception { public void testStateMachine2() throws Exception {
StateMachine2 sm2 = new StateMachine2("sm2"); StateMachine2 sm2 = new StateMachine2("sm2");
sm2.start(); sm2.start();
@@ -646,7 +638,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private ChildState mChildState = new ChildState(); private ChildState mChildState = new ChildState();
} }
@SmallTest @MediumTest
public void testStateMachine3() throws Exception { public void testStateMachine3() throws Exception {
StateMachine3 sm3 = new StateMachine3("sm3"); StateMachine3 sm3 = new StateMachine3("sm3");
sm3.start(); sm3.start();
@@ -739,7 +731,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private ChildState2 mChildState2 = new ChildState2(); private ChildState2 mChildState2 = new ChildState2();
} }
@SmallTest @MediumTest
public void testStateMachine4() throws Exception { public void testStateMachine4() throws Exception {
StateMachine4 sm4 = new StateMachine4("sm4"); StateMachine4 sm4 = new StateMachine4("sm4");
sm4.start(); sm4.start();
@@ -1013,7 +1005,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private int mChildState5ExitCount = 0; private int mChildState5ExitCount = 0;
} }
@SmallTest @MediumTest
public void testStateMachine5() throws Exception { public void testStateMachine5() throws Exception {
StateMachine5 sm5 = new StateMachine5("sm5"); StateMachine5 sm5 = new StateMachine5("sm5");
sm5.start(); sm5.start();
@@ -1141,7 +1133,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private long mArrivalTimeMsg2; private long mArrivalTimeMsg2;
} }
@SmallTest @MediumTest
public void testStateMachine6() throws Exception { public void testStateMachine6() throws Exception {
long sentTimeMsg2; long sentTimeMsg2;
final int DELAY_TIME = 250; final int DELAY_TIME = 250;
@@ -1251,7 +1243,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private long mArrivalTimeMsg3; private long mArrivalTimeMsg3;
} }
@SmallTest @MediumTest
public void testStateMachine7() throws Exception { public void testStateMachine7() throws Exception {
long sentTimeMsg2; long sentTimeMsg2;
final int SM7_DELAY_FUDGE = 20; final int SM7_DELAY_FUDGE = 20;
@@ -1403,7 +1395,7 @@ public class HierarchicalStateMachineTest extends TestCase {
private static int sharedCounter = 0; private static int sharedCounter = 0;
private static Object waitObject = new Object(); private static Object waitObject = new Object();
@SmallTest @MediumTest
public void testStateMachineSharedThread() throws Exception { public void testStateMachineSharedThread() throws Exception {
if (DBG) Log.d(TAG, "testStateMachineSharedThread E"); if (DBG) Log.d(TAG, "testStateMachineSharedThread E");
@@ -1448,7 +1440,7 @@ public class HierarchicalStateMachineTest extends TestCase {
if (DBG) Log.d(TAG, "testStateMachineSharedThread X"); if (DBG) Log.d(TAG, "testStateMachineSharedThread X");
} }
@SmallTest @MediumTest
public void testHsm1() throws Exception { public void testHsm1() throws Exception {
if (DBG) Log.d(TAG, "testHsm1 E"); if (DBG) Log.d(TAG, "testHsm1 E");

View File

@@ -16,11 +16,8 @@
package android.os; package android.os;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.PerformanceCollector;
import android.os.Process;
import android.os.PerformanceCollector.PerformanceResultsWriter; import android.os.PerformanceCollector.PerformanceResultsWriter;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@@ -56,7 +53,7 @@ public class PerformanceCollectorTest extends TestCase {
assertEquals(2, snapshot.size()); assertEquals(2, snapshot.size());
} }
@SmallTest @MediumTest
public void testEndSnapshotNoWriter() throws Exception { public void testEndSnapshotNoWriter() throws Exception {
mPerfCollector.beginSnapshot("testEndSnapshotNoWriter"); mPerfCollector.beginSnapshot("testEndSnapshotNoWriter");
workForRandomLongPeriod(); workForRandomLongPeriod();
@@ -116,7 +113,7 @@ public class PerformanceCollectorTest extends TestCase {
assertEquals(2, snapshot.size()); assertEquals(2, snapshot.size());
} }
@SmallTest @MediumTest
public void testEndSnapshot() throws Exception { public void testEndSnapshot() throws Exception {
MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter(); MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter();
mPerfCollector.setPerformanceResultsWriter(writer); mPerfCollector.setPerformanceResultsWriter(writer);
@@ -232,7 +229,7 @@ public class PerformanceCollectorTest extends TestCase {
assertEquals("Hello World", results.getString("testAddMeasurementStringNonEmpty")); assertEquals("Hello World", results.getString("testAddMeasurementStringNonEmpty"));
} }
@SmallTest @MediumTest
public void testSimpleSequence() throws Exception { public void testSimpleSequence() throws Exception {
MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter(); MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter();
mPerfCollector.setPerformanceResultsWriter(writer); mPerfCollector.setPerformanceResultsWriter(writer);
@@ -264,7 +261,7 @@ public class PerformanceCollectorTest extends TestCase {
verifyTimingBundle(timing, labels); verifyTimingBundle(timing, labels);
} }
@SmallTest @MediumTest
public void testLongSequence() throws Exception { public void testLongSequence() throws Exception {
MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter(); MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter();
mPerfCollector.setPerformanceResultsWriter(writer); mPerfCollector.setPerformanceResultsWriter(writer);
@@ -350,7 +347,7 @@ public class PerformanceCollectorTest extends TestCase {
* Verify that snapshotting and timing do not interfere w/ each other, * Verify that snapshotting and timing do not interfere w/ each other,
* by staggering calls to snapshot and timing functions. * by staggering calls to snapshot and timing functions.
*/ */
@SmallTest @MediumTest
public void testOutOfOrderSequence() { public void testOutOfOrderSequence() {
MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter(); MockPerformanceResultsWriter writer = new MockPerformanceResultsWriter();
mPerfCollector.setPerformanceResultsWriter(writer); mPerfCollector.setPerformanceResultsWriter(writer);

View File

@@ -17,9 +17,8 @@
package android.os; package android.os;
import android.content.Context; import android.content.Context;
import android.os.PowerManager;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest;
public class PowerManagerTest extends AndroidTestCase { public class PowerManagerTest extends AndroidTestCase {
@@ -39,7 +38,7 @@ public class PowerManagerTest extends AndroidTestCase {
* *
* @throws Exception * @throws Exception
*/ */
@MediumTest @SmallTest
public void testPreconditions() throws Exception { public void testPreconditions() throws Exception {
assertNotNull(mPm); assertNotNull(mPm);
} }
@@ -49,7 +48,7 @@ public class PowerManagerTest extends AndroidTestCase {
* *
* @throws Exception * @throws Exception
*/ */
@MediumTest @SmallTest
public void testNewWakeLock() throws Exception { public void testNewWakeLock() throws Exception {
PowerManager.WakeLock wl = mPm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "FULL_WAKE_LOCK"); PowerManager.WakeLock wl = mPm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "FULL_WAKE_LOCK");
doTestWakeLock(wl); doTestWakeLock(wl);
@@ -74,7 +73,7 @@ public class PowerManagerTest extends AndroidTestCase {
* *
* @throws Exception * @throws Exception
*/ */
@MediumTest @SmallTest
public void testBadNewWakeLock() throws Exception { public void testBadNewWakeLock() throws Exception {
final int badFlags = PowerManager.SCREEN_BRIGHT_WAKE_LOCK final int badFlags = PowerManager.SCREEN_BRIGHT_WAKE_LOCK

View File

@@ -19,7 +19,6 @@ package android.text;
import android.content.res.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.text.style.QuoteSpan; import android.text.style.QuoteSpan;
@@ -36,7 +35,7 @@ import junit.framework.TestCase;
public class HtmlTest extends TestCase { public class HtmlTest extends TestCase {
@MediumTest @SmallTest
public void testSingleTagOnWhileString() { public void testSingleTagOnWhileString() {
Spanned spanned = Html.fromHtml("<b>hello</b>"); Spanned spanned = Html.fromHtml("<b>hello</b>");
Object[] spans = spanned.getSpans(-1, 100, Object.class); Object[] spans = spanned.getSpans(-1, 100, Object.class);
@@ -46,7 +45,7 @@ public class HtmlTest extends TestCase {
assertEquals(5, spanned.getSpanEnd(span)); assertEquals(5, spanned.getSpanEnd(span));
} }
@MediumTest @SmallTest
public void testEmptyFontTag() { public void testEmptyFontTag() {
Spanned spanned = Html.fromHtml("Hello <font color=\"#ff00ff00\"></font>"); Spanned spanned = Html.fromHtml("Hello <font color=\"#ff00ff00\"></font>");
Object[] spans = spanned.getSpans(0, 100, Object.class); Object[] spans = spanned.getSpans(0, 100, Object.class);
@@ -54,7 +53,7 @@ public class HtmlTest extends TestCase {
} }
/** Tests that the parser can handle mal-formed HTML. */ /** Tests that the parser can handle mal-formed HTML. */
@MediumTest @SmallTest
public void testBadHtml() { public void testBadHtml() {
Spanned spanned = Html.fromHtml("Hello <b>b<i>bi</b>i</i>"); Spanned spanned = Html.fromHtml("Hello <b>b<i>bi</b>i</i>");
Object[] spans = spanned.getSpans(0, 100, Object.class); Object[] spans = spanned.getSpans(0, 100, Object.class);
@@ -69,13 +68,13 @@ public class HtmlTest extends TestCase {
assertEquals(10, spanned.getSpanEnd(spans[2])); assertEquals(10, spanned.getSpanEnd(spans[2]));
} }
@MediumTest @SmallTest
public void testSymbols() { public void testSymbols() {
String spanned = Html.fromHtml("&copy; &gt; &lt").toString(); String spanned = Html.fromHtml("&copy; &gt; &lt").toString();
assertEquals("\u00a9 > <", spanned); assertEquals("\u00a9 > <", spanned);
} }
@MediumTest @SmallTest
public void testColor() throws Exception { public void testColor() throws Exception {
Spanned s; Spanned s;
ForegroundColorSpan[] colors; ForegroundColorSpan[] colors;
@@ -95,7 +94,7 @@ public class HtmlTest extends TestCase {
assertEquals(0, colors.length); assertEquals(0, colors.length);
} }
@MediumTest @SmallTest
public void testResourceColor() throws Exception { public void testResourceColor() throws Exception {
ColorStateList c = ColorStateList c =
Resources.getSystem().getColorStateList(android.R.color.primary_text_dark); Resources.getSystem().getColorStateList(android.R.color.primary_text_dark);

View File

@@ -17,10 +17,8 @@
package android.text.util; package android.text.util;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.widget.TextView; import android.widget.TextView;
/** /**
@@ -39,7 +37,7 @@ public class LinkifyTest extends AndroidTestCase {
assertTrue(tv.getUrls().length == 0); assertTrue(tv.getUrls().length == 0);
} }
@MediumTest @SmallTest
public void testNormal() throws Exception { public void testNormal() throws Exception {
TextView tv; TextView tv;

View File

@@ -16,13 +16,11 @@
package android.util; package android.util;
import junit.framework.TestCase; import android.test.suitebuilder.annotation.SmallTest;
import junit.framework.Test;
import junit.framework.TestSuite;
import java.util.Calendar; import java.util.Calendar;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.MediumTest; import junit.framework.TestCase;
/** /**
* Unit tests for {@link MonthDisplayHelper}. * Unit tests for {@link MonthDisplayHelper}.
@@ -42,7 +40,7 @@ public class MonthDisplayHelperTest extends TestCase {
new MonthDisplayHelper(2007, Calendar.SEPTEMBER).getFirstDayOfMonth()); new MonthDisplayHelper(2007, Calendar.SEPTEMBER).getFirstDayOfMonth());
} }
@MediumTest @SmallTest
public void testNumberOfDaysInCurrentMonth() { public void testNumberOfDaysInCurrentMonth() {
assertEquals(30, assertEquals(30,
new MonthDisplayHelper(2007, Calendar.SEPTEMBER).getNumberOfDaysInMonth()); new MonthDisplayHelper(2007, Calendar.SEPTEMBER).getNumberOfDaysInMonth());

View File

@@ -18,7 +18,6 @@ package android.view;
import android.graphics.Rect; import android.graphics.Rect;
import android.test.AndroidTestCase; import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest; import android.test.suitebuilder.annotation.SmallTest;
public class FocusFinderTest extends AndroidTestCase { public class FocusFinderTest extends AndroidTestCase {
@@ -239,7 +238,7 @@ public class FocusFinderTest extends AndroidTestCase {
* A non-candidate (even a much closer one) is always a worse choice * A non-candidate (even a much closer one) is always a worse choice
* than a real candidate. * than a real candidate.
*/ */
@MediumTest @SmallTest
public void testSomeCandidateBetterThanNonCandidate() { public void testSomeCandidateBetterThanNonCandidate() {
Rect src = new Rect(0, 0, 50, 50); // (left, top, right, bottom) Rect src = new Rect(0, 0, 50, 50); // (left, top, right, bottom)

View File

@@ -14,8 +14,7 @@
package android.view.accessibility; package android.view.accessibility;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest;
import android.view.accessibility.AccessibilityEvent;
import junit.framework.TestCase; import junit.framework.TestCase;
@@ -39,7 +38,7 @@ public class RecycleAccessibilityEventTest extends TestCase {
/** /**
* If an {@link AccessibilityEvent} is marshaled/unmarshaled correctly * If an {@link AccessibilityEvent} is marshaled/unmarshaled correctly
*/ */
@MediumTest @SmallTest
public void testAccessibilityEventViewTextChangedType() { public void testAccessibilityEventViewTextChangedType() {
AccessibilityEvent first = AccessibilityEvent first =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);

View File

@@ -16,23 +16,22 @@
package android.widget; package android.widget;
import android.test.TouchUtils;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.android.frameworks.coretests.R; import com.android.frameworks.coretests.R;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
/** /**
* Exercises {@link android.widget.RadioGroup}'s check feature. * Exercises {@link android.widget.RadioGroup}'s check feature.
*/ */
public class RadioGroupPreCheckedTest extends ActivityInstrumentationTestCase2<RadioGroupActivity> { public class RadioGroupPreCheckedTest extends ActivityInstrumentationTestCase2<RadioGroupActivity> {
public RadioGroupPreCheckedTest() { public RadioGroupPreCheckedTest() {
super("com.android.frameworks.coretests", RadioGroupActivity.class); super(RadioGroupActivity.class);
} }
@LargeTest @MediumTest
public void testRadioButtonPreChecked() throws Exception { public void testRadioButtonPreChecked() throws Exception {
final RadioGroupActivity activity = getActivity(); final RadioGroupActivity activity = getActivity();

View File

@@ -62,20 +62,20 @@ public class ExpandableListWithHeadersTest extends
assertTrue(mExpandableListView.isGroupExpanded(0)); assertTrue(mExpandableListView.isGroupExpanded(0));
} }
@MediumTest @LargeTest
public void testContextMenus() { public void testContextMenus() {
ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this); ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this);
tester.testContextMenus(); tester.testContextMenus();
} }
@MediumTest @LargeTest
public void testConvertionBetweenFlatAndPacked() { public void testConvertionBetweenFlatAndPacked() {
ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this); ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this);
tester.testConvertionBetweenFlatAndPackedOnGroups(); tester.testConvertionBetweenFlatAndPackedOnGroups();
tester.testConvertionBetweenFlatAndPackedOnChildren(); tester.testConvertionBetweenFlatAndPackedOnChildren();
} }
@MediumTest @LargeTest
public void testSelectedPosition() { public void testSelectedPosition() {
ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this); ExpandableListTester tester = new ExpandableListTester(mExpandableListView, this);
tester.testSelectedPositionOnGroups(); tester.testSelectedPositionOnGroups();

View File

@@ -67,7 +67,7 @@ public class GridTouchStackFromBottomManyTest extends ActivityInstrumentationTes
mGridView.getListPaddingTop(), firstChild.getTop()); mGridView.getListPaddingTop(), firstChild.getTop());
} }
@MediumTest @LargeTest
public void testScrollToBottom() { public void testScrollToBottom() {
TouchUtils.scrollToBottom(this, mGridView); TouchUtils.scrollToBottom(this, mGridView);

View File

@@ -16,22 +16,20 @@
package android.widget.listview.arrowscroll; package android.widget.listview.arrowscroll;
import android.test.ActivityInstrumentationTestCase; import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.widget.ListView; import android.util.ListUtil;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.ListView;
import android.widget.listview.ListInterleaveFocusables; import android.widget.listview.ListInterleaveFocusables;
import android.util.ListUtil;
public class ListInterleaveFocusablesTest extends ActivityInstrumentationTestCase<ListInterleaveFocusables> { public class ListInterleaveFocusablesTest extends ActivityInstrumentationTestCase2<ListInterleaveFocusables> {
private ListView mListView; private ListView mListView;
private ListUtil mListUtil; private ListUtil mListUtil;
public ListInterleaveFocusablesTest() { public ListInterleaveFocusablesTest() {
super("com.android.frameworks.coretests", ListInterleaveFocusables.class); super(ListInterleaveFocusables.class);
} }
@Override @Override
@@ -42,7 +40,7 @@ public class ListInterleaveFocusablesTest extends ActivityInstrumentationTestCas
mListUtil = new ListUtil(mListView, getInstrumentation()); mListUtil = new ListUtil(mListView, getInstrumentation());
} }
@LargeTest @MediumTest
public void testPreconditions() { public void testPreconditions() {
assertEquals(7, mListView.getChildCount()); assertEquals(7, mListView.getChildCount());
assertTrue(mListView.getChildAt(1).isFocusable()); assertTrue(mListView.getChildAt(1).isFocusable());

View File

@@ -16,16 +16,15 @@
package android.widget.listview.arrowscroll; package android.widget.listview.arrowscroll;
import android.test.ActivityInstrumentationTestCase; import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.widget.ListView;
import android.view.View;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import android.widget.ListView;
import android.widget.listview.ListOfItemsTallerThanScreen; import android.widget.listview.ListOfItemsTallerThanScreen;
public class ListOfItemsTallerThanScreenTest public class ListOfItemsTallerThanScreenTest
extends ActivityInstrumentationTestCase<ListOfItemsTallerThanScreen> { extends ActivityInstrumentationTestCase2<ListOfItemsTallerThanScreen> {
private ListView mListView; private ListView mListView;
private ListOfItemsTallerThanScreen mActivity; private ListOfItemsTallerThanScreen mActivity;
@@ -38,7 +37,7 @@ public class ListOfItemsTallerThanScreenTest
} }
public ListOfItemsTallerThanScreenTest() { public ListOfItemsTallerThanScreenTest() {
super("com.android.frameworks.coretests", ListOfItemsTallerThanScreen.class); super(ListOfItemsTallerThanScreen.class);
} }
@MediumTest @MediumTest
@@ -126,7 +125,7 @@ public class ListOfItemsTallerThanScreenTest
1, mListView.getChildCount()); 1, mListView.getChildCount());
} }
@LargeTest @MediumTest
public void testScrollDownToLastItem() { public void testScrollDownToLastItem() {
final int numItems = mListView.getAdapter().getCount(); final int numItems = mListView.getAdapter().getCount();

View File

@@ -16,20 +16,19 @@
package android.widget.listview.arrowscroll; package android.widget.listview.arrowscroll;
import android.test.ActivityInstrumentationTestCase; import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.util.ListUtil;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.widget.ListView; import android.widget.ListView;
import android.widget.listview.ListOfShortShortTallShortShort; import android.widget.listview.ListOfShortShortTallShortShort;
import android.util.ListUtil;
public class ListOfShortShortTallShortShortTest extends ActivityInstrumentationTestCase<ListOfShortShortTallShortShort> { public class ListOfShortShortTallShortShortTest extends ActivityInstrumentationTestCase2<ListOfShortShortTallShortShort> {
private ListView mListView; private ListView mListView;
private ListUtil mListUtil; private ListUtil mListUtil;
public ListOfShortShortTallShortShortTest() { public ListOfShortShortTallShortShortTest() {
super("com.android.frameworks.coretests", ListOfShortShortTallShortShort.class); super(ListOfShortShortTallShortShort.class);
} }
@Override @Override
@@ -68,7 +67,7 @@ public class ListOfShortShortTallShortShortTest extends ActivityInstrumentationT
1, mListView.getChildCount()); 1, mListView.getChildCount());
} }
@LargeTest @MediumTest
public void testFadeInTwoBottomItems() { public void testFadeInTwoBottomItems() {
// put 2nd item selected // put 2nd item selected
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN); sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
@@ -89,7 +88,7 @@ public class ListOfShortShortTallShortShortTest extends ActivityInstrumentationT
mListView.getChildAt(2).getBottom() >= mListUtil.getListBottom()); mListView.getChildAt(2).getBottom() >= mListUtil.getListBottom());
} }
@LargeTest @MediumTest
public void testFadeOutBottomTwoItems() throws Exception { public void testFadeOutBottomTwoItems() throws Exception {
mListUtil.arrowScrollToSelectedPosition(4); mListUtil.arrowScrollToSelectedPosition(4);
@@ -110,7 +109,7 @@ public class ListOfShortShortTallShortShortTest extends ActivityInstrumentationT
1, mListView.getChildCount()); 1, mListView.getChildCount());
} }
@LargeTest @MediumTest
public void testFadeInTopTwoItems() throws Exception { public void testFadeInTopTwoItems() throws Exception {
mListUtil.arrowScrollToSelectedPosition(4); mListUtil.arrowScrollToSelectedPosition(4);

View File

@@ -16,21 +16,19 @@
package android.widget.listview.arrowscroll; package android.widget.listview.arrowscroll;
import android.widget.listview.ListWithScreenOfNoSelectables; import android.test.ActivityInstrumentationTestCase2;
import android.test.ActivityInstrumentationTestCase;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.ListView; import android.widget.ListView;
import android.widget.listview.ListWithScreenOfNoSelectables;
public class ListWithScreenOfNoSelectablesTest extends ActivityInstrumentationTestCase<ListWithScreenOfNoSelectables> { public class ListWithScreenOfNoSelectablesTest extends ActivityInstrumentationTestCase2<ListWithScreenOfNoSelectables> {
private ListView mListView; private ListView mListView;
public ListWithScreenOfNoSelectablesTest() { public ListWithScreenOfNoSelectablesTest() {
super("com.android.frameworks.coretests", ListWithScreenOfNoSelectables.class); super(ListWithScreenOfNoSelectables.class);
} }
@Override @Override
@@ -56,7 +54,7 @@ public class ListWithScreenOfNoSelectablesTest extends ActivityInstrumentationTe
@MediumTest @MediumTest
public void testGoFromSelectedViewExistsToNoSelectedViewExists() { public void testGoFromSelectedViewExistsToNoSelectedViewExists() {
// go down untile first (and only selectable) item is off screen // go down until first (and only selectable) item is off screen
View first = mListView.getChildAt(0); View first = mListView.getChildAt(0);
while (first.getParent() != null) { while (first.getParent() != null) {
sendKeys(KeyEvent.KEYCODE_DPAD_DOWN); sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);
@@ -67,7 +65,7 @@ public class ListWithScreenOfNoSelectablesTest extends ActivityInstrumentationTe
assertNull("selected view", mListView.getSelectedView()); assertNull("selected view", mListView.getSelectedView());
} }
@LargeTest @MediumTest
public void testPanDownAcrossUnselectableChildrenToBottom() { public void testPanDownAcrossUnselectableChildrenToBottom() {
final int lastPosition = mListView.getCount() - 1; final int lastPosition = mListView.getCount() - 1;
final int maxDowns = 20; final int maxDowns = 20;