public interface

HostActivity.HostedTest

 androidx.media3.test.utils.HostActivity.HostedTest

Subclasses:

ExoHostedTest

Overview

Interface for tests that run inside of a HostActivity.

Summary

Methods
public booleanblockUntilStopped(long timeoutMs)

Called on the main thread to block until the test has stopped or HostActivity.HostedTest.forceStop() is called.

public booleanforceStop()

Called on the main thread to force stop the test (if it is not stopped already).

public voidonFinished()

Called on the test thread after the test has finished and been stopped.

public voidonStart(HostActivity host, Surface surface, FrameLayout overlayFrameLayout)

Called on the main thread when the test is started.

Methods

public void onStart(HostActivity host, Surface surface, FrameLayout overlayFrameLayout)

Called on the main thread when the test is started.

The test will not be started until the HostActivity has been resumed and its has been created.

Parameters:

host: The HostActivity in which the test is being run.
surface: The .
overlayFrameLayout: A FrameLayout that is on top of the surface.

public boolean blockUntilStopped(long timeoutMs)

Called on the main thread to block until the test has stopped or HostActivity.HostedTest.forceStop() is called.

Parameters:

timeoutMs: The maximum time to block in milliseconds.

Returns:

Whether the test has stopped successful.

public boolean forceStop()

Called on the main thread to force stop the test (if it is not stopped already).

Returns:

Whether the test was forced stopped.

public void onFinished()

Called on the test thread after the test has finished and been stopped.

Implementations may use this method to assert that test criteria were met.