Merge "Allow alternative time zone ID to be set device's zone." am: 2cd0b0aadf
am: 87273aab56
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1652336 Change-Id: I8cce932794d13dd8f9424883b9521a823583f335
This commit is contained in:
@@ -92,4 +92,23 @@ public class TimeZoneDataTest {
|
||||
.containsExactly("US", "GB");
|
||||
assertThat(timeZoneData.lookupCountryCodesForZoneId("Unknown/Secret_City2")).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lookupCountryCodesForNonCanonicalZoneId_returnsCurrentZone() {
|
||||
TimeZoneData timeZoneData = new TimeZoneData(mCountryZonesFinder);
|
||||
|
||||
CountryTimeZones greenland = mock(CountryTimeZones.class);
|
||||
when(greenland.getCountryIso()).thenReturn("gl");
|
||||
when(greenland.getTimeZoneMappings()).thenReturn(Arrays.asList(
|
||||
TimeZoneMapping.createForTests(
|
||||
"America/Nuuk",
|
||||
true /* showInPicker */,
|
||||
null /* notUsedAfter */,
|
||||
Arrays.asList("America/Godthab"))));
|
||||
when(mCountryZonesFinder.lookupCountryTimeZonesForZoneId("America/Godthab"))
|
||||
.thenReturn(Arrays.asList(greenland));
|
||||
|
||||
assertThat(timeZoneData.lookupCountryCodesForZoneId("America/Godthab"))
|
||||
.containsExactly("GL");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user