Change DataUsageSummaryPreference.setLimitInfo(String text) to take CharSequence

"CharSequence is more correct" than String.
Change method to take in CharSequence parameter and modify callers/tests.

Bug: b/74960034

Test: RunSettingsRoboTests:DataUsageSummaryPreferenceTest and RunSettingsRoboTests:DataUsageSummaryPreferenceControllerTest
Change-Id: Ic83bde57bafff8416c0bd86b1ff2beb44ea12d0e
This commit is contained in:
vincentpeng
2018-03-28 10:46:17 +08:00
parent e008845287
commit 665b16bbfc
4 changed files with 53 additions and 14 deletions

View File

@@ -304,6 +304,15 @@ public class DataUsageSummaryPreferenceTest {
assertThat(mDataLimits.getVisibility()).isEqualTo(View.GONE);
}
@Test
public void testSetLimitInfo_withEmptyLimitInfo_dataLimitsNotShown() {
final String emptyLimitText = "";
mSummaryPreference.setLimitInfo(emptyLimitText);
bindViewHolder();
assertThat(mDataLimits.getVisibility()).isEqualTo(View.GONE);
}
@Test
public void testSetChartEnabledFalse_hidesLabelBar() {
setValidLabels();