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:
@@ -93,8 +93,9 @@ public final class BatteryChartPreferenceControllerTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
|
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
Locale.setDefault(new Locale("en_US"));
|
||||||
|
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
|
||||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||||
mMetricsFeatureProvider = mFeatureFactory.metricsFeatureProvider;
|
mMetricsFeatureProvider = mFeatureFactory.metricsFeatureProvider;
|
||||||
mContext = spy(RuntimeEnvironment.application);
|
mContext = spy(RuntimeEnvironment.application);
|
||||||
|
@@ -60,6 +60,8 @@ public final class ConvertUtilsTest {
|
|||||||
mContext = spy(RuntimeEnvironment.application);
|
mContext = spy(RuntimeEnvironment.application);
|
||||||
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
mFeatureFactory = FakeFeatureFactory.setupForTest();
|
||||||
mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
|
mPowerUsageFeatureProvider = mFeatureFactory.powerUsageFeatureProvider;
|
||||||
|
Locale.setDefault(new Locale("en_US"));
|
||||||
|
org.robolectric.shadows.ShadowSettings.set24HourTimeFormat(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user