Merge "Add null check for worker"

This commit is contained in:
TreeHugger Robot
2019-03-18 18:01:08 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 2 deletions

View File

@@ -93,6 +93,13 @@ public class MediaOutputSliceTest {
mMediaOutputSlice.init(TEST_PACKAGE_NAME, mMediaDeviceUpdateWorker);
}
@Test
public void getSlice_workerIsNull_shouldNotCrash() {
mMediaOutputSlice.init(TEST_PACKAGE_NAME, null);
mMediaOutputSlice.getSlice();
}
@Test
public void getSlice_shouldHaveActiveDeviceName() {
mDevices.clear();