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

Commit cc120dd6 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaSession2: Re-enable MediaSessionManager releated tests

Some tests were  previously disabled because the server didn't recognize
test apk installation. Re-enable those tests.

Some tests were broken while they had been hidden, and later CLs will
fix failures.

Bug: 72613128
Test: Run all MediaComponents tests. Following failures will be fixed
      in next CLs
        - MediaSessionmanager_MediaSession2
            #testGetSessionTokens_sessionRejected
        - MediaController2Test#testConnectToService_libraryService
Change-Id: Ib312aa55403f9ba67644389873c009b7e31c0b00
parent bc05249d
Loading
Loading
Loading
Loading
+1 −16
Original line number Diff line number Diff line
@@ -36,11 +36,9 @@ import android.os.ResultReceiver;
import android.support.test.filters.FlakyTest;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.text.TextUtils;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@@ -601,7 +599,6 @@ public class MediaController2Test extends MediaSession2TestBase {
        }
    }

    @Ignore
    @Test
    public void testGetServiceToken() {
        SessionToken2 token = TestUtils.getServiceToken(mContext, MockMediaSessionService2.ID);
@@ -617,15 +614,11 @@ public class MediaController2Test extends MediaSession2TestBase {
        mPlayer = (MockPlayer) mSession.getPlayer();
    }

    // TODO(jaewan): Reenable when session manager detects app installs
    @Ignore
    @Test
    public void testConnectToService_sessionService() throws InterruptedException {
        testConnectToService(MockMediaSessionService2.ID);
    }

    // TODO(jaewan): Reenable when session manager detects app installs
    @Ignore
    @Test
    public void testConnectToService_libraryService() throws InterruptedException {
        testConnectToService(MockMediaLibraryService2.ID);
@@ -668,15 +661,11 @@ public class MediaController2Test extends MediaSession2TestBase {
        */
    }

    // TODO(jaewan): Re-enable after b/72792686 is fixed
    @Ignore
    @Test
    public void testControllerAfterSessionIsGone_session() throws InterruptedException {
        testControllerAfterSessionIsGone(mSession.getToken().getId());
    }

    // TODO(jaewan): Re-enable after b/72792686 is fixed
    @Ignore
    @Test
    public void testControllerAfterSessionIsGone_sessionService() throws InterruptedException {
        connectToService(TestUtils.getServiceToken(mContext, MockMediaSessionService2.ID));
@@ -708,15 +697,11 @@ public class MediaController2Test extends MediaSession2TestBase {
        testControllerAfterSessionIsGone(id);
    }

    // TODO(jaewan): Reenable when session manager detects app installs
    @Ignore
    @Test
    public void testClose_sessionService() throws InterruptedException {
        testCloseFromService(MockMediaSessionService2.ID);
    }

    // TODO(jaewan): Reenable when session manager detects app installs
    @Ignore
    @Test
    public void testClose_libraryService() throws InterruptedException {
        testCloseFromService(MockMediaLibraryService2.ID);
@@ -751,7 +736,7 @@ public class MediaController2Test extends MediaSession2TestBase {
        waitForDisconnect(mController, true);
        testNoInteraction();

        // Test with the newly created session.
        // Ensure that the controller cannot use newly create session with the same ID.
        sHandler.postAndSync(() -> {
            // Recreated session has different session stub, so previously created controller
            // shouldn't be available.
+1 −5
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.support.test.runner.AndroidJUnit4;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@@ -40,9 +39,6 @@ import static org.junit.Assert.*;
 */
@RunWith(AndroidJUnit4.class)
@SmallTest
@Ignore
// TODO(jaewan): Reenable test when the media session service detects newly installed sesison
//               service app.
public class MediaSessionManager_MediaSession2 extends MediaSession2TestBase {
    private static final String TAG = "MediaSessionManager_MediaSession2";

@@ -101,7 +97,7 @@ public class MediaSessionManager_MediaSession2 extends MediaSession2TestBase {
    }

    /**
     * Test if server recognizes session even if session refuses the connection from server.
     * Test if server recognizes a session even if the session refuses the connection from server.
     *
     * @throws InterruptedException
     */