HostActivity.HostedTest


interface HostActivity.HostedTest

Known direct subclasses
ExoHostedTest

A HostedTest for ExoPlayer playback tests.


Interface for tests that run inside of a HostActivity.

Summary

Public functions

Boolean
blockUntilStopped(timeoutMs: Long)

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

Boolean

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

Unit

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

Unit
onStart(
    host: HostActivity!,
    surface: Surface!,
    overlayFrameLayout: FrameLayout!
)

Called on the main thread when the test is started.

Public functions

blockUntilStopped

fun blockUntilStopped(timeoutMs: Long): Boolean

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

Parameters
timeoutMs: Long

The maximum time to block in milliseconds.

Returns
Boolean

Whether the test has stopped successful.

forceStop

fun forceStop(): Boolean

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

Returns
Boolean

Whether the test was forced stopped.

onFinished

fun onFinished(): Unit

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.

onStart

fun onStart(
    host: HostActivity!,
    surface: Surface!,
    overlayFrameLayout: FrameLayout!
): Unit

Called on the main thread when the test is started.

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

Parameters
host: HostActivity!

The HostActivity in which the test is being run.

surface: Surface!

The Surface.

overlayFrameLayout: FrameLayout!

A FrameLayout that is on top of the surface.