Merge "Add flag to control whether or not we should tint icons"

This commit is contained in:
TreeHugger Robot
2017-04-28 18:16:25 +00:00
committed by Android (Google) Code Review
6 changed files with 43 additions and 13 deletions

View File

@@ -20,6 +20,7 @@ import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
import android.os.Bundle;
@@ -364,4 +365,16 @@ public class DashboardFeatureProviderImplTest {
public void testGetExtraIntentAction_shouldReturnNull() {
assertThat(mImpl.getExtraIntentAction()).isNull();
}
@Test
public void testShouldTintIcon_shouldReturnValueFromResource() {
final Resources res = mActivity.getApplicationContext().getResources();
when(res.getBoolean(R.bool.config_tintSettingIcon))
.thenReturn(false);
assertThat(mImpl.shouldTintIcon()).isFalse();
when(res.getBoolean(R.bool.config_tintSettingIcon))
.thenReturn(true);
assertThat(mImpl.shouldTintIcon()).isTrue();
}
}