Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9b740df authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix Settings password robo tests.

Bug: 151913744
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.password
Change-Id: I7d4f221f4f4c0375f06780f907b769946aebd272
parent 23562377
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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));
+5 −7
Original line number Diff line number Diff line
@@ -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));
    }