Merge "Set default locale in the testing environment to avoid flaky test" into sc-dev am: 3940e5293c am: 4e55c543fa

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14782142

Change-Id: Iad1c67df730296e4ae747522e304ee1f108551bb
This commit is contained in:
YUKAI HUNG
2021-06-01 09:21:32 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 1 deletions

View File

@@ -93,8 +93,9 @@ public final class BatteryChartPreferenceControllerTest {
@Before
public void setUp() {
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
MockitoAnnotations.initMocks(this);
Locale.setDefault(new Locale("en_US"));
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
mFeatureFactory = FakeFeatureFactory.setupForTest();
mMetricsFeatureProvider = mFeatureFactory.metricsFeatureProvider;
mContext = spy(RuntimeEnvironment.application);

View File

@@ -60,6 +60,8 @@ public final class ConvertUtilsTest {
mContext = spy(RuntimeEnvironment.application);
mFeatureFactory = FakeFeatureFactory.setupForTest();
mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
Locale.setDefault(new Locale("en_US"));
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
}
@Test