Commit 6f8863fc by christosts Committed by Marc Baechinger

Minor naming cleanup in MediaControllerListenerTest

PiperOrigin-RevId: 480041937
parent 266de1b2
......@@ -258,7 +258,7 @@ public class MediaControllerListenerTest {
threadTestRule.getHandler().postAndSync(controller::release);
// release is done immediately for session.
testNoInteraction(controller);
assertNoInteraction(controller);
// Test whether the controller is notified about later release of the session or
// re-creation.
......@@ -2603,31 +2603,28 @@ public class MediaControllerListenerTest {
// This causes the session service to die.
remoteSession.release();
// controllerTestRule.waitForDisconnect(controller, true);
testNoInteraction(controller);
assertNoInteraction(controller);
// Ensure that the controller cannot use newly create session with the same ID.
// Recreated session has different session stub, so previously created controller
// shouldn't be available.
remoteSession = createRemoteMediaSession(id);
testNoInteraction(controller);
assertNoInteraction(controller);
}
// Test that session and controller doesn't interact.
// Note that this method can be called after the session is died, so session may not have
// valid player.
private void testNoInteraction(MediaController controller) throws Exception {
/**
* Asserts that {@link #remoteSession} and {@code controller} don't interact.
*
* <p>Note that this method can be called after the session is died, so {@link #remoteSession} may
* not have valid player.
*/
private void assertNoInteraction(MediaController controller) throws Exception {
// TODO: check that calls from the controller to session shouldn't be delivered.
// Calls from the session to controller shouldn't be delivered.
CountDownLatch latch = new CountDownLatch(1);
controllerTestRule.setRunnableForOnCustomCommand(
controller,
new Runnable() {
@Override
public void run() {
latch.countDown();
}
});
controller, /* runnable= */ () -> latch.countDown());
SessionCommand customCommand =
new SessionCommand("testNoInteraction", /* extras= */ Bundle.EMPTY);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment