Loading tests/SmokeTest/tests/AndroidManifest.xml +0 −9 Original line number Diff line number Diff line Loading @@ -26,15 +26,6 @@ <uses-library android:name="android.test.runner" /> </application> <!-- This declares that this app uses the instrumentation test runner targeting the package of com.android.smoketest. To run the tests use the command: `adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner` --> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.android.smoketest" android:label="System Smoke Tests"/> <!-- This declares a method to run the instrumentation with a special runner, which will run each app as a separate testcase. To do so, use the command: Loading tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -154,6 +154,11 @@ public class ProcessErrorsTest extends AndroidTestCase { // launch app, and wait 7 seconds for it to start/settle final Intent intent = intentForActivity(app); if (intent == null) { Log.i(TAG, String.format("Activity %s/%s is disabled, skipping", app.activityInfo.packageName, app.activityInfo.name)); return Collections.EMPTY_LIST; } getContext().startActivity(intent); try { Thread.sleep(appLaunchWait); Loading Loading @@ -238,10 +243,16 @@ public class ProcessErrorsTest extends AndroidTestCase { /** * A helper function to create an {@link Intent} to run, given a {@link ResolveInfo} specifying * an activity to be launched. * * @return the {@link Intent} or <code>null</code> if given app is disabled */ static Intent intentForActivity(ResolveInfo app) { Intent intentForActivity(ResolveInfo app) { final ComponentName component = new ComponentName(app.activityInfo.packageName, app.activityInfo.name); if (getContext().getPackageManager().getComponentEnabledSetting(component) == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) { return null; } final Intent intent = new Intent(Intent.ACTION_MAIN); intent.setComponent(component); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Loading Loading
tests/SmokeTest/tests/AndroidManifest.xml +0 −9 Original line number Diff line number Diff line Loading @@ -26,15 +26,6 @@ <uses-library android:name="android.test.runner" /> </application> <!-- This declares that this app uses the instrumentation test runner targeting the package of com.android.smoketest. To run the tests use the command: `adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner` --> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.android.smoketest" android:label="System Smoke Tests"/> <!-- This declares a method to run the instrumentation with a special runner, which will run each app as a separate testcase. To do so, use the command: Loading
tests/SmokeTest/tests/src/com/android/smoketest/ProcessErrorsTest.java +12 −1 Original line number Diff line number Diff line Loading @@ -154,6 +154,11 @@ public class ProcessErrorsTest extends AndroidTestCase { // launch app, and wait 7 seconds for it to start/settle final Intent intent = intentForActivity(app); if (intent == null) { Log.i(TAG, String.format("Activity %s/%s is disabled, skipping", app.activityInfo.packageName, app.activityInfo.name)); return Collections.EMPTY_LIST; } getContext().startActivity(intent); try { Thread.sleep(appLaunchWait); Loading Loading @@ -238,10 +243,16 @@ public class ProcessErrorsTest extends AndroidTestCase { /** * A helper function to create an {@link Intent} to run, given a {@link ResolveInfo} specifying * an activity to be launched. * * @return the {@link Intent} or <code>null</code> if given app is disabled */ static Intent intentForActivity(ResolveInfo app) { Intent intentForActivity(ResolveInfo app) { final ComponentName component = new ComponentName(app.activityInfo.packageName, app.activityInfo.name); if (getContext().getPackageManager().getComponentEnabledSetting(component) == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) { return null; } final Intent intent = new Intent(Intent.ACTION_MAIN); intent.setComponent(component); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Loading