Merge "Fix Battery page animation" into qt-qpr1-dev
am: 8b348f1f30
Change-Id: I922be1ac21e17c9ae71d7721401a08bbd56ca020
This commit is contained in:
@@ -85,7 +85,6 @@ public class BatteryHeaderPreferenceControllerTest {
|
||||
private BatteryMeterView mBatteryMeterView;
|
||||
private TextView mBatteryPercentText;
|
||||
private TextView mSummary;
|
||||
private TextView mSummary2;
|
||||
private LayoutPreference mBatteryLayoutPref;
|
||||
private Intent mBatteryIntent;
|
||||
private LifecycleOwner mLifecycleOwner;
|
||||
@@ -102,7 +101,6 @@ public class BatteryHeaderPreferenceControllerTest {
|
||||
mBatteryPercentText = new TextView(mContext);
|
||||
mSummary = new TextView(mContext);
|
||||
ShadowEntityHeaderController.setUseMock(mEntityHeaderController);
|
||||
mSummary2 = new TextView(mContext);
|
||||
|
||||
mBatteryIntent = new Intent();
|
||||
mBatteryIntent.putExtra(BatteryManager.EXTRA_LEVEL, BATTERY_LEVEL);
|
||||
@@ -126,7 +124,6 @@ public class BatteryHeaderPreferenceControllerTest {
|
||||
mController.mBatteryMeterView = mBatteryMeterView;
|
||||
mController.mBatteryPercentText = mBatteryPercentText;
|
||||
mController.mSummary1 = mSummary;
|
||||
mController.mSummary2 = mSummary2;
|
||||
}
|
||||
|
||||
@After
|
||||
@@ -190,7 +187,6 @@ public class BatteryHeaderPreferenceControllerTest {
|
||||
@Test
|
||||
public void quickUpdateHeaderPreference_onlyUpdateBatteryLevelAndChargingState() {
|
||||
mSummary.setText(BATTERY_STATUS);
|
||||
mSummary2.setText(BATTERY_STATUS);
|
||||
|
||||
mController.quickUpdateHeaderPreference();
|
||||
|
||||
@@ -198,7 +194,6 @@ public class BatteryHeaderPreferenceControllerTest {
|
||||
assertThat(mBatteryMeterView.getCharging()).isTrue();
|
||||
assertThat(mBatteryPercentText.getText().toString()).isEqualTo("60 %");
|
||||
assertThat(mSummary.getText()).isEqualTo(BATTERY_STATUS);
|
||||
assertThat(mSummary2.getText()).isEqualTo(BATTERY_STATUS);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -265,20 +265,17 @@ public class PowerUsageSummaryTest {
|
||||
}
|
||||
}).when(mFeatureFactory.powerUsageFeatureProvider).getEnhancedEstimateDebugString(any());
|
||||
|
||||
doReturn(new TextView(mRealContext)).when(mBatteryLayoutPref).findViewById(R.id.summary2);
|
||||
doReturn(new TextView(mRealContext)).when(mBatteryLayoutPref).findViewById(R.id.summary1);
|
||||
mFragment.onLongClick(new View(mRealContext));
|
||||
TextView summary1 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary1);
|
||||
TextView summary2 = mFragment.mBatteryLayoutPref.findViewById(R.id.summary2);
|
||||
Robolectric.flushBackgroundThreadScheduler();
|
||||
assertThat(summary2.getText().toString()).contains(NEW_ML_EST_SUFFIX);
|
||||
assertThat(summary1.getText().toString()).contains(NEW_ML_EST_SUFFIX);
|
||||
assertThat(summary1.getText().toString()).contains(OLD_EST_SUFFIX);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void debugMode() {
|
||||
doReturn(true).when(mFeatureFactory.powerUsageFeatureProvider).isEstimateDebugEnabled();
|
||||
doReturn(new TextView(mRealContext)).when(mBatteryLayoutPref).findViewById(R.id.summary2);
|
||||
|
||||
mFragment.restartBatteryInfoLoader();
|
||||
ArgumentCaptor<View.OnLongClickListener> listener = ArgumentCaptor.forClass(
|
||||
|
Reference in New Issue
Block a user