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

Commit e4288a08 authored by Hyundo Moon's avatar Hyundo Moon
Browse files

Add test for MediaRouter2#getControllers

Test: atest mediaroutertest
Change-Id: I5ef3d3887281751cabe5d433a080e616a695e1aa
parent 29d2fc2f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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<>();