Merge tests calling onStart and onStop am: b932920c6f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20024531

Change-Id: If6efefddccf7aba4c18ddab94ed7939979252d40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Santiago Seifert
2022-09-24 00:53:25 +00:00
committed by Automerger Merge Worker

View File

@@ -241,46 +241,29 @@ public class MediaOutputBaseDialogTest extends SysuiTestCase {
}
@Test
public void onStart_isBroadcasting_verifyRegisterLeBroadcastServiceCallBack() {
public void whenBroadcasting_verifyLeBroadcastServiceCallBackIsRegisteredAndUnregistered() {
when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
mLocalBluetoothLeBroadcast);
mIsBroadcasting = true;
mMediaOutputBaseDialogImpl.onStart();
verify(mLocalBluetoothLeBroadcast).registerServiceCallBack(any(), any());
}
@Test
public void onStart_notBroadcasting_noRegisterLeBroadcastServiceCallBack() {
when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
mLocalBluetoothLeBroadcast);
mIsBroadcasting = false;
mMediaOutputBaseDialogImpl.onStart();
verify(mLocalBluetoothLeBroadcast, never()).registerServiceCallBack(any(), any());
}
@Test
public void onStart_isBroadcasting_verifyUnregisterLeBroadcastServiceCallBack() {
when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
mLocalBluetoothLeBroadcast);
mIsBroadcasting = true;
mMediaOutputBaseDialogImpl.onStop();
verify(mLocalBluetoothLeBroadcast).unregisterServiceCallBack(any());
}
@Test
public void onStop_notBroadcasting_noUnregisterLeBroadcastServiceCallBack() {
public void
whenNotBroadcasting_verifyLeBroadcastServiceCallBackIsNotRegisteredOrUnregistered() {
when(mLocalBluetoothProfileManager.getLeAudioBroadcastProfile()).thenReturn(
mLocalBluetoothLeBroadcast);
mIsBroadcasting = false;
mMediaOutputBaseDialogImpl.onStart();
mMediaOutputBaseDialogImpl.onStop();
verify(mLocalBluetoothLeBroadcast, never()).registerServiceCallBack(any(), any());
verify(mLocalBluetoothLeBroadcast, never()).unregisterServiceCallBack(any());
}