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

Commit 1676454b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix failed test cases" into rvc-dev

parents 334985fe 98a8640d
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();
    }