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

Commit fd77ab61 authored by Wes Okuhara's avatar Wes Okuhara
Browse files

Settings: Fix queryShortcuts_shouldOnlyIncludeSystemApp test

Previously this test asserted that the ActivityInfo instances
were the same address. While this can assert general equality,
it is more robust to assert the ActivityInfo's properties-
mainly that the associated application is a system app.

Bug: b/314924127
Test: atest SettingsRoboTests:com.android.settings.shortcut.CreateShortcutPreferenceControllerTest
Flag: TEST_ONLY
Change-Id: I0d60fb848afdd40cecf3f3393421006ad1ff1086
parent 3d21de7e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@ public class CreateShortcutPreferenceControllerTest {
                .isEqualTo(SHORTCUT_ID_PREFIX + intent.getComponent().flattenToShortString());
    }

    @Ignore("b/314924127")
    @Test
    public void queryShortcuts_shouldOnlyIncludeSystemApp() {
        final ResolveInfo ri1 = new ResolveInfo();
@@ -137,7 +136,9 @@ public class CreateShortcutPreferenceControllerTest {
        doReturn(false).when(mController).canShowWifiHotspot();
        final List<ResolveInfo> info = mController.queryShortcuts();
        assertThat(info).hasSize(1);
        assertThat(info.get(0).activityInfo).isEqualTo(ri2.activityInfo);
        final ActivityInfo resultActivityInfo = info.get(0).activityInfo;
        assertThat(resultActivityInfo.name).isEqualTo(ri2.activityInfo.name);
        assertThat(resultActivityInfo.applicationInfo.isSystemApp()).isTrue();
    }

    @Ignore("b/314924127")