Show prediction time when both value are ready
Bug: 215767460 Test: make -j64 RunSettingsRoboTests Change-Id: I07947b3eca1f656e0dc603f9b9839825dd3149fd
This commit is contained in:
@@ -387,34 +387,52 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showBatteryPredictionIfNecessary_estimateReadyIsAvailable_showView() {
|
||||
mController.showBatteryPredictionIfNecessary(1, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_left));
|
||||
mController.showBatteryPredictionIfNecessary(1, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_middle));
|
||||
mController.showBatteryPredictionIfNecessary(1, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_right));
|
||||
public void estimateReadyIsBothAvailable_showsView() {
|
||||
mController.mIsLeftDeviceEstimateReady = true;
|
||||
mController.mIsRightDeviceEstimateReady = true;
|
||||
|
||||
mController.showBothDevicesBatteryPredictionIfNecessary();
|
||||
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_left),
|
||||
View.VISIBLE);
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_middle),
|
||||
View.VISIBLE);
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_right),
|
||||
View.VISIBLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void showBatteryPredictionIfNecessary_estimateReadyIsNotAvailable_notShowView() {
|
||||
mController.showBatteryPredictionIfNecessary(0, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_left));
|
||||
mController.showBatteryPredictionIfNecessary(0, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_middle));
|
||||
mController.showBatteryPredictionIfNecessary(0, 14218009,
|
||||
mLayoutPreference.findViewById(R.id.layout_right));
|
||||
public void leftDeviceEstimateIsReadyRightDeviceIsNotReady_notShowView() {
|
||||
mController.mIsLeftDeviceEstimateReady = true;
|
||||
mController.mIsRightDeviceEstimateReady = false;
|
||||
|
||||
mController.showBothDevicesBatteryPredictionIfNecessary();
|
||||
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_left),
|
||||
View.GONE);
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_middle),
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_right),
|
||||
View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void leftDeviceEstimateIsNotReadyRightDeviceIsReady_notShowView() {
|
||||
mController.mIsLeftDeviceEstimateReady = false;
|
||||
mController.mIsRightDeviceEstimateReady = true;
|
||||
|
||||
mController.showBothDevicesBatteryPredictionIfNecessary();
|
||||
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_left),
|
||||
View.GONE);
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_right),
|
||||
View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bothDevicesEstimateIsNotReady_notShowView() {
|
||||
mController.mIsLeftDeviceEstimateReady = false;
|
||||
mController.mIsRightDeviceEstimateReady = false;
|
||||
|
||||
mController.showBothDevicesBatteryPredictionIfNecessary();
|
||||
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_left),
|
||||
View.GONE);
|
||||
assertBatteryPredictionVisible(mLayoutPreference.findViewById(R.id.layout_right),
|
||||
View.GONE);
|
||||
|
Reference in New Issue
Block a user