Fix Settings password robo tests.

Bug: 151913744
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.password
Change-Id: I7d4f221f4f4c0375f06780f907b769946aebd272
This commit is contained in:
Rubin Xu
2021-03-19 11:35:57 +00:00
parent 23562377b0
commit d9b740df26
2 changed files with 5 additions and 9 deletions

View File

@@ -65,7 +65,6 @@ import com.android.settingslib.widget.FooterPreference;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
@@ -233,7 +232,6 @@ public class ChooseLockGenericTest {
}
@Test
@Ignore
public void updatePreferencesOrFinish_callingAppIsAdmin_deviceNotProvisioned_footerInvisible() {
Global.putInt(application.getContentResolver(), Global.DEVICE_PROVISIONED, 0);
initActivity(new Intent().putExtra(EXTRA_KEY_IS_CALLING_APP_ADMIN, true));

View File

@@ -50,7 +50,6 @@ import com.google.android.setupcompat.util.WizardManagerHelper;
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;
@@ -105,18 +104,17 @@ public class SetNewPasswordActivityTest {
}
@Test
@Ignore
public void testSetupChooseLockGeneric() {
Settings.Global.putInt(RuntimeEnvironment.application.getContentResolver(),
Settings.Global.DEVICE_PROVISIONED, 0);
Intent intent = new Intent(ACTION_SET_NEW_PASSWORD);
intent.putExtra(WizardManagerHelper.EXTRA_IS_SETUP_FLOW, true);
SetNewPasswordActivity activity =
Robolectric.buildActivity(SetNewPasswordActivity.class).get();
activity.launchChooseLock(new Bundle());
Robolectric.buildActivity(SetNewPasswordActivity.class, intent).create().get();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
Intent intent = getLaunchChooseLockIntent(shadowActivity);
intent.putExtra(WizardManagerHelper.EXTRA_IS_FIRST_RUN, true);
assertThat(intent.getComponent())
Intent nextIntent = shadowActivity.getNextStartedActivityForResult().intent;
assertThat(nextIntent.getComponent())
.isEqualTo(new ComponentName(activity, SetupChooseLockGeneric.class));
}