Revert "Ignore a lot of failed test cases on Settings"

This reverts commit d9d08ebd4f.

Bug: 154727109
Test: make RunSettingsRoboTests
Exempt-From-Owner-Approval: re-enabling tests
Change-Id: I4ed490f0199683ee84d687be17f7e90091deb7f1
This commit is contained in:
Jeff Sharkey
2020-04-22 11:22:38 -06:00
committed by Jeff Sharkey
parent d579af4d22
commit 1a703c4846
13 changed files with 9 additions and 49 deletions

View File

@@ -62,7 +62,6 @@ import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -133,7 +132,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testGetAggregatedUsageEvents_onlyNotificationEvents() throws Exception {
List<Event> events = new ArrayList<>();
Event good = new Event();
@@ -156,7 +154,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testGetAggregatedUsageEvents_multipleEventsAgg() throws Exception {
List<Event> events = new ArrayList<>();
Event good = new Event();
@@ -180,7 +177,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testGetAggregatedUsageEvents_multiplePkgs() throws Exception {
List<Event> events = new ArrayList<>();
Event good = new Event();
@@ -219,7 +215,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testLoadAllExtraInfo_multipleEventsAgg() throws RemoteException {
List<Event> events = new ArrayList<>();
for (int i = 0; i < 7; i++) {
@@ -249,7 +244,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testLoadAllExtraInfo_multiplePkgs() throws RemoteException {
List<Event> events = new ArrayList<>();
for (int i = 0; i < 8; i++) {
@@ -287,7 +281,6 @@ public class AppStateNotificationBridgeTest {
}
@Test
@Ignore
public void testLoadAllExtraInfo_multipleUsers() throws RemoteException {
// has work profile
when(mUserManager.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[]{1});

View File

@@ -30,7 +30,6 @@ import com.android.settings.core.BasePreferenceController;
import com.google.common.collect.ImmutableList;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@@ -50,7 +49,6 @@ public class InteractAcrossProfilesPreferenceControllerTest {
new InteractAcrossProfilesDetailsPreferenceController(mContext, "test_key");
@Test
@Ignore
public void getAvailabilityStatus_requestedCrossProfilePermission_returnsAvailable() {
mController.setPackageName(CROSS_PROFILE_PACKAGE_NAME);
shadowOf(mPackageManager).setInstalledPackagesForUserId(

View File

@@ -37,7 +37,6 @@ import androidx.test.core.app.ApplicationProvider;
import com.google.common.collect.ImmutableList;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@@ -74,7 +73,6 @@ public class InteractAcrossProfilesSettingsTest {
private final AppOpsManager mAppOpsManager = mContext.getSystemService(AppOpsManager.class);
@Test
@Ignore
public void collectConfigurableApps_fromPersonal_returnsCombinedPackages() {
shadowOf(mUserManager).addUser(
PERSONAL_PROFILE_ID, "personal-profile"/* name */, 0/* flags */);
@@ -100,7 +98,6 @@ public class InteractAcrossProfilesSettingsTest {
}
@Test
@Ignore
public void collectConfigurableApps_fromWork_returnsCombinedPackages() {
shadowOf(mUserManager).addUser(
PERSONAL_PROFILE_ID, "personal-profile"/* name */, 0/* flags */);
@@ -142,7 +139,6 @@ public class InteractAcrossProfilesSettingsTest {
}
@Test
@Ignore
public void getNumberOfEnabledApps_returnsNumberOfEnabledApps() {
shadowOf(mUserManager).addUser(
PERSONAL_PROFILE_ID, "personal-profile"/* name */, 0/* flags */);

View File

@@ -22,14 +22,13 @@ import android.os.Parcel;
import android.text.format.DateUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.robolectric.RobolectricTestRunner;
@RunWith(RobolectricTestRunner.class)
public class AppInfoTest {
@@ -56,7 +55,6 @@ public class AppInfoTest {
}
@Test
@Ignore
public void testParcel() {
Parcel parcel = Parcel.obtain();
mAppInfo.writeToParcel(parcel, mAppInfo.describeContents());

View File

@@ -28,7 +28,6 @@ import com.android.settings.fuelgauge.batterytip.AppInfo;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -66,7 +65,6 @@ public class HighUsageTipTest {
}
@Test
@Ignore
public void testParcelable() {
Parcel parcel = Parcel.obtain();

View File

@@ -26,7 +26,6 @@ import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -54,7 +53,6 @@ public class LowBatteryTipTest {
}
@Test
@Ignore
public void testParcelable() {
Parcel parcel = Parcel.obtain();
mLowBatteryTip.writeToParcel(parcel, mLowBatteryTip.describeContents());

View File

@@ -34,21 +34,21 @@ import android.os.Parcel;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.fuelgauge.batterytip.AppInfo;
import com.android.settings.testutils.BatteryTestUtils;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.util.ReflectionHelpers;
import java.util.ArrayList;
import java.util.List;
import org.robolectric.util.ReflectionHelpers;
@RunWith(RobolectricTestRunner.class)
public class RestrictAppTipTest {
@@ -110,7 +110,6 @@ public class RestrictAppTipTest {
}
@Test
@Ignore
public void parcelable() {
Parcel parcel = Parcel.obtain();
mNewBatteryTip.writeToParcel(parcel, mNewBatteryTip.describeContents());

View File

@@ -22,14 +22,12 @@ import android.os.Parcel;
import com.android.settings.fuelgauge.batterytip.AppInfo;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
@RunWith(RobolectricTestRunner.class)
@Ignore
public class UnrestrictAppTipTest {
private static final String PACKAGE_NAME = "com.android.app";

View File

@@ -54,7 +54,6 @@ import com.android.settings.testutils.shadow.ShadowRestrictedLockUtilsInternal;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -115,7 +114,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_hasSuggestedApp_shouldHaveNotificationChannelTitle() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);
@@ -131,7 +129,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_hasSuggestedApp_shouldSortByNotificationSentCount() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);
@@ -227,7 +224,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_exceedDefaultRowCount_shouldOnlyShowDefaultRows() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);
@@ -245,7 +241,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_channelCountIsLessThanDefaultRows_subTitleShouldNotHaveTapToManagerAll() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);
@@ -262,7 +257,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_channelCountIsEqualToDefaultRows_subTitleShouldNotHaveTapToManagerAll() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);
@@ -278,7 +272,6 @@ public class NotificationChannelSliceTest {
@Test
@Config(shadows = ShadowRestrictedLockUtilsInternal.class)
@Ignore
public void getSlice_channelCountIsMoreThanDefaultRows_subTitleShouldHaveTapToManagerAll() {
addMockPackageToPackageManager(true /* isRecentlyInstalled */,
ApplicationInfo.FLAG_INSTALLED);

View File

@@ -33,7 +33,6 @@ import android.util.ArraySet;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@@ -81,7 +80,6 @@ public class NotificationChannelWorkerTest {
}
@Test
@Ignore
public void onSliceUnpinned_interactedPackageIsInstalled_shouldKeepPackage() {
mockInteractedPackageAsInstalled();

View File

@@ -33,7 +33,6 @@ import android.os.Parcel;
import com.android.settings.notification.NotificationBackend.AppRow;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@@ -94,7 +93,6 @@ public class NotificationBackendTest {
}
@Test
@Ignore
public void testGetAggregatedUsageEvents_multipleEventsAgg() {
List<UsageEvents.Event> events = new ArrayList<>();
UsageEvents.Event good = new UsageEvents.Event();

View File

@@ -47,19 +47,12 @@ import android.os.UserManager;
import android.service.notification.NotifyingApp;
import android.text.TextUtils;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settingslib.applications.AppUtils;
import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.instantapps.InstantAppDataProvider;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -74,6 +67,12 @@ import org.robolectric.util.ReflectionHelpers;
import java.util.ArrayList;
import java.util.List;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
@RunWith(RobolectricTestRunner.class)
public class RecentNotifyingAppsPreferenceControllerTest {
@@ -153,7 +152,6 @@ public class RecentNotifyingAppsPreferenceControllerTest {
}
@Test
@Ignore
public void display_showRecents() throws Exception {
List<Event> events = new ArrayList<>();
Event app = new Event();
@@ -201,7 +199,6 @@ public class RecentNotifyingAppsPreferenceControllerTest {
}
@Test
@Ignore
public void display_showRecentsWithInstantApp() throws Exception {
List<Event> events = new ArrayList<>();
Event app = new Event();
@@ -257,7 +254,6 @@ public class RecentNotifyingAppsPreferenceControllerTest {
}
@Test
@Ignore
public void display_showRecents_formatSummary() throws Exception {
List<Event> events = new ArrayList<>();
Event app = new Event();
@@ -282,7 +278,6 @@ public class RecentNotifyingAppsPreferenceControllerTest {
}
@Test
@Ignore
public void reloadData() throws Exception {
when(mUserManager.getProfileIdsWithDisabled(0)).thenReturn(new int[] {0, 10});

View File

@@ -47,7 +47,6 @@ import com.android.settingslib.widget.RadioButtonPreference;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -310,7 +309,6 @@ public class WebViewAppPickerTest {
* preference title.
*/
@Test
@Ignore
public void testWebViewVersionAddedAfterLabel() {
final DefaultAppInfo webviewAppInfo = mPicker.createDefaultAppInfo(mContext,
mContext.getPackageManager(),