Merge "Fix failed test cases" into rvc-dev am: 1676454b3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/11970207 Change-Id: I20545916f5ca886d67e10adf9c68a4656988f27d
This commit is contained in:
@@ -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<>();
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user