summaryrefslogtreecommitdiff
path: root/library/test/robotest/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'library/test/robotest/src/com')
-rw-r--r--library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java b/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java
index 683e40b..f8e71be 100644
--- a/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java
+++ b/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java
@@ -132,6 +132,20 @@ public class PartnerTest {
}
@Test
+ public void getColor_shouldReturnPartnerValueIfPresent() {
+ final int expectedPartnerColor = 1111;
+ doReturn(12345).when(mPartnerResources)
+ .getIdentifier(eq("suw_color_accent_dark"), eq("color"), anyString());
+ doReturn(expectedPartnerColor).when(mPartnerResources).getColor(eq(12345));
+ mPackageManager.addResolveInfoForIntent(
+ new Intent(ACTION_PARTNER_CUSTOMIZATION),
+ Arrays.asList(createResolveInfo("test.partner.package", true, true)));
+ final int foundColor = Partner.getColor(mContext, R.color.suw_color_accent_dark);
+ assertEquals("Partner color should be overlayed to: " + expectedPartnerColor,
+ expectedPartnerColor, foundColor);
+ }
+
+ @Test
public void testLoadDefaultValue() {
mPackageManager.addResolveInfoForIntent(
new Intent(ACTION_PARTNER_CUSTOMIZATION),