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

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

Change-Id: I56b9c9432c4fb3cfc9170569fb690c71f2b01acd
This commit is contained in:
YUKAI HUNG
2021-06-01 08:48:03 +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