Search in sources :

Example 11 with Presubmit

use of android.platform.test.annotations.Presubmit in project android_packages_apps_Settings by omnirom.

the class SettingsSearchIndexablesProviderTest method nonIndexableKeys_shouldNotCrash.

/**
 * All {@link Indexable.SearchIndexProvider} should collect a list of non-indexable keys
 * without crashing. This test enables crashing of individual providers in the indexing pipeline
 * and checks that there are no crashes.
 */
@Test
@Presubmit
public void nonIndexableKeys_shouldNotCrash() {
    // Allow crashes in the indexing pipeline.
    System.setProperty(SettingsSearchIndexablesProvider.SYSPROP_CRASH_ON_ERROR, "enabled");
    final Uri uri = Uri.parse("content://" + mContext.getPackageName() + "/" + SearchIndexablesContract.NON_INDEXABLES_KEYS_PATH);
    mContext.getContentResolver().query(uri, null, null, null, null);
}
Also used : Uri(android.net.Uri) Presubmit(android.platform.test.annotations.Presubmit) SmallTest(androidx.test.filters.SmallTest) Test(org.junit.Test)

Example 12 with Presubmit

use of android.platform.test.annotations.Presubmit in project android_packages_apps_Settings by omnirom.

the class HomepageDisplayTests method testHomepageCategory.

@Presubmit
@Test
public void testHomepageCategory() throws Exception {
    // Launch Settings
    SettingsHelper.launchSettingsPage(InstrumentationRegistry.getContext(), Settings.ACTION_SETTINGS);
    // Scroll to top
    final UiObject2 view = mDevice.wait(Until.findObject(By.res(SETTINGS_PACKAGE, "main_content")), TIMEOUT);
    view.scroll(Direction.UP, 100f);
    // Inspect each item
    for (String item : HOMEPAGE_ITEMS) {
        SettingsTestUtils.assertTitleMatch(mDevice, item);
    }
}
Also used : UiObject2(android.support.test.uiautomator.UiObject2) Presubmit(android.platform.test.annotations.Presubmit) MediumTest(androidx.test.filters.MediumTest) Test(org.junit.Test)

Aggregations

Presubmit (android.platform.test.annotations.Presubmit)12 Test (org.junit.Test)12 SmallTest (androidx.test.filters.SmallTest)7 MediumTest (androidx.test.filters.MediumTest)5 UiObject2 (android.support.test.uiautomator.UiObject2)4 Uri (android.net.Uri)3 SearchIndexableResources (com.android.settingslib.search.SearchIndexableResources)3 HashSet (java.util.HashSet)3 ComponentName (android.content.ComponentName)1 ContentResolver (android.content.ContentResolver)1 Intent (android.content.Intent)1 ActivityInfo (android.content.pm.ActivityInfo)1 PackageInfo (android.content.pm.PackageInfo)1 ResolveInfo (android.content.pm.ResolveInfo)1 Cursor (android.database.Cursor)1 Bundle (android.os.Bundle)1 ArraySet (android.util.ArraySet)1 Indexable (com.android.settings.search.Indexable)1 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)1 ArrayList (java.util.ArrayList)1