diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-06-09 03:42:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-06-09 03:42:34 +0000 |
commit | 18a78a41029878c0211a01947632b62a58604239 (patch) | |
tree | 34c3d08f8cf631e60a050abdd078fa7d58456b68 /library/test/robotest | |
parent | 2a1e150e068fc0218cfecf2e6dddb55fbe246ef2 (diff) | |
parent | 1d05333434b4e0f009fbce9a22e8e31521f86cad (diff) | |
download | setupwizard-18a78a41029878c0211a01947632b62a58604239.tar.gz |
Merge "Fix Partner.getText"
Diffstat (limited to 'library/test/robotest')
-rw-r--r-- | library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java | 15 |
1 files changed, 15 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 f8e71be..2285cd5 100644 --- a/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java +++ b/library/test/robotest/src/com/android/setupwizardlib/util/PartnerTest.java @@ -16,6 +16,8 @@ package com.android.setupwizardlib.util; +import static com.google.common.truth.Truth.assertThat; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -146,6 +148,19 @@ public class PartnerTest { } @Test + public void getText_shouldReturnPartnerValueIfPresent() { + final CharSequence expectedPartnerText = "partner"; + doReturn(12345).when(mPartnerResources) + .getIdentifier(eq("suw_next_button_label"), eq("string"), anyString()); + doReturn(expectedPartnerText).when(mPartnerResources).getText(eq(12345)); + mPackageManager.addResolveInfoForIntent( + new Intent(ACTION_PARTNER_CUSTOMIZATION), + Collections.singletonList(createResolveInfo("test.partner.package", true, true))); + final CharSequence partnerText = Partner.getText(mContext, R.string.suw_next_button_label); + assertThat(partnerText).isEqualTo(expectedPartnerText); + } + + @Test public void testLoadDefaultValue() { mPackageManager.addResolveInfoForIntent( new Intent(ACTION_PARTNER_CUSTOMIZATION), |