Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faf618af authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "le_audio: Fix test flakiness by waiting for scheduled callbacks" into...

Merge "le_audio: Fix test flakiness by waiting for scheduled callbacks" into main am: 561c612d am: b2632456

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3063343



Change-Id: I1232e0597818a107673813ebbf082997ed14def8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cedfa41d b2632456
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2394,6 +2394,7 @@ public class LeAudioServiceTest {
        injectAudioConfChanged(groupId, availableContexts, direction);

        assertThat(mService.setActiveDevice(mLeftDevice)).isTrue();
        TestUtils.waitForLooperToFinishScheduledTask(mService.getMainLooper());

        doReturn(-1).when(mVolumeControlService).getAudioDeviceGroupVolume(groupId);
        //Set group and device as active.
@@ -2411,6 +2412,7 @@ public class LeAudioServiceTest {

        verify(mAudioManager, times(1)).handleBluetoothActiveDeviceChanged(eq(null), any(),
                        any(BluetoothProfileConnectionInfo.class));
        TestUtils.waitForLooperToFinishScheduledTask(mService.getMainLooper());

        doReturn(100).when(mVolumeControlService).getAudioDeviceGroupVolume(groupId);

@@ -2445,6 +2447,7 @@ public class LeAudioServiceTest {
        // Add location support.
        injectAudioConfChanged(groupId, availableContexts, direction);
        assertThat(mService.setActiveDevice(mLeftDevice)).isTrue();
        TestUtils.waitForLooperToFinishScheduledTask(mService.getMainLooper());

        doReturn(volume).when(mVolumeControlService).getAudioDeviceGroupVolume(groupId);
        // Set group and device as active.
@@ -2460,6 +2463,7 @@ public class LeAudioServiceTest {
        verify(mAudioManager, times(1))
                .handleBluetoothActiveDeviceChanged(
                        eq(null), any(), any(BluetoothProfileConnectionInfo.class));
        TestUtils.waitForLooperToFinishScheduledTask(mService.getMainLooper());

        // Verify setGroupVolume will not be called if no active sinks
        doReturn(new ArrayList<>()).when(mBassClientService).getActiveBroadcastSinks();