Merge "Fix display wrong information "pair left/right ear" on device detail page when disconnect one of HA"

This commit is contained in:
Jason Hsu
2022-09-16 09:34:39 +00:00
committed by Android (Google) Code Review
2 changed files with 25 additions and 8 deletions

View File

@@ -56,7 +56,7 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
}
@Test
public void init_leftSideDevice_expectedTitle() {
public void init_leftSideDevice_rightSideButtonTitle() {
when(mCachedDevice.getDeviceSide()).thenReturn(HearingAidProfile.DeviceSide.SIDE_LEFT);
mController.init(mScreen);
@@ -66,7 +66,7 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
}
@Test
public void init_rightSideDevice_expectedTitle() {
public void init_rightSideDevice_leftSideButtonTitle() {
when(mCachedDevice.getDeviceSide()).thenReturn(HearingAidProfile.DeviceSide.SIDE_RIGHT);
mController.init(mScreen);
@@ -118,4 +118,15 @@ public class BluetoothDetailsPairOtherControllerTest extends BluetoothDetailsCon
assertThat(mController.isAvailable()).isTrue();
}
@Test
public void refresh_leftSideDevice_leftSideButtonTitle() {
when(mCachedDevice.getDeviceSide()).thenReturn(HearingAidProfile.DeviceSide.SIDE_RIGHT);
mController.init(mScreen);
mController.refresh();
assertThat(mPreference.getTitle().toString()).isEqualTo(
mContext.getString(R.string.bluetooth_pair_left_ear_button));
}
}