Merge "Merge "When only one device is selected in dynamic group, the device should be disabled" into rvc-dev am: 8d2c8f1f33 am: 6ca2cc572e" into rvc-d1-dev-plus-aosp am: a4dd00a45e am: 6c51001c11

Change-Id: I1ad5b35496defc482d2ae1f98b75adbc40fc1a2a
This commit is contained in:
Automerger Merge Worker
2020-05-14 02:09:44 +00:00
3 changed files with 15 additions and 11 deletions

View File

@@ -212,11 +212,9 @@ public class MediaOutputGroupSliceTest {
}
@Test
public void onNotifyChange_sessionOperation_differentClient_verifyAddSession() {
mSelectableDevices.add(mDevice1);
public void onNotifyChange_sendSelectableDevice_verifyAddSession() {
mSelectableDevices.add(mDevice2);
mSelectedDevices.add(mDevice1);
when(mDevice2.getClientPackageName()).thenReturn(TEST_PACKAGE_NAME2);
when(mLocalMediaManager.getMediaDeviceById(mSelectableDevices, TEST_DEVICE_2_ID))
.thenReturn(mDevice2);
sMediaDeviceUpdateWorker.onDeviceListUpdate(mSelectableDevices);
@@ -229,16 +227,13 @@ public class MediaOutputGroupSliceTest {
verify(sMediaDeviceUpdateWorker).addDeviceToPlayMedia(mDevice2);
}
@Test
public void onNotifyChange_sessionOperation_sameClient_verifyRemoveSession() {
mSelectableDevices.add(mDevice1);
mSelectableDevices.add(mDevice2);
public void onNotifyChange_sendSelectedDevice_verifyRemoveSession() {
mSelectedDevices.add(mDevice1);
when(mDevice2.getClientPackageName()).thenReturn(TEST_PACKAGE_NAME);
when(mLocalMediaManager.getMediaDeviceById(mSelectableDevices, TEST_DEVICE_2_ID))
mSelectedDevices.add(mDevice2);
when(mLocalMediaManager.getMediaDeviceById(mSelectedDevices, TEST_DEVICE_2_ID))
.thenReturn(mDevice2);
sMediaDeviceUpdateWorker.onDeviceListUpdate(mSelectableDevices);
sMediaDeviceUpdateWorker.onDeviceListUpdate(mSelectedDevices);
when(sMediaDeviceUpdateWorker.getSelectedMediaDevice()).thenReturn(mSelectedDevices);
final Intent intent = new Intent();
intent.putExtra(MEDIA_DEVICE_ID, TEST_DEVICE_2_ID);