Merge "Add test for MediaRouter2#getControllers"

This commit is contained in:
Hyundo Moon
2020-01-22 03:31:17 +00:00
committed by Android (Google) Code Review

View File

@@ -36,6 +36,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.testng.Assert.assertThrows;
@@ -693,6 +694,14 @@ public class MediaRouter2Test {
assertFalse(systemController.isReleased());
}
@Test
public void testControllers() {
List<RoutingController> controllers = mRouter2.getControllers();
assertNotNull(controllers);
assertFalse(controllers.isEmpty());
assertSame(mRouter2.getSystemController(), controllers.get(0));
}
// Helper for getting routes easily
static Map<String, MediaRoute2Info> createRouteMap(List<MediaRoute2Info> routes) {
Map<String, MediaRoute2Info> routeMap = new HashMap<>();