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

Commit eadd54e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix failed test cases" into rvc-dev am: 1676454b

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11970207

Change-Id: I20545916f5ca886d67e10adf9c68a4656988f27d
parents 1431d764 1676454b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -184,6 +184,10 @@ public class ContextualCardLoader extends AsyncLoaderCompat<List<ContextualCard>

    @VisibleForTesting
    List<ContextualCard> filterEligibleCards(List<ContextualCard> candidates) {
        if (candidates.isEmpty()) {
            return candidates;
        }

        final ExecutorService executor = Executors.newFixedThreadPool(candidates.size());
        final List<ContextualCard> cards = new ArrayList<>();
        List<Future<ContextualCard>> eligibleCards = new ArrayList<>();
+7 −3
Original line number Diff line number Diff line
@@ -270,23 +270,27 @@ public class SettingsSliceProviderTest {

    @Test
    public void onBindSlice_nightModeChanged_shouldReloadTheme() {
        mContext.getResources().getConfiguration().uiMode = UI_MODE_NIGHT_YES;

        mContext.getResources().getConfiguration().uiMode = UI_MODE_NIGHT_NO;
        final SliceData data = getDummyData();
        mProvider.mSliceWeakDataCache.put(data.getUri(), data);
        mProvider.onBindSlice(data.getUri());

        mContext.getResources().getConfiguration().uiMode = UI_MODE_NIGHT_YES;
        mProvider.onBindSlice(data.getUri());

        assertThat(ShadowTheme.isThemeRebased()).isTrue();
    }

    @Test
    public void onBindSlice_nightModeNotChanged_shouldNotReloadTheme() {
        mContext.getResources().getConfiguration().uiMode = UI_MODE_NIGHT_NO;

        SliceData data = getDummyData();
        mProvider.mSliceWeakDataCache.put(data.getUri(), data);
        mProvider.onBindSlice(data.getUri());

        mContext.getResources().getConfiguration().uiMode = UI_MODE_NIGHT_NO;
        mProvider.onBindSlice(data.getUri());

        assertThat(ShadowTheme.isThemeRebased()).isFalse();
    }