Back to Exoplayer

HostActivity.HostedTest (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/HostActivity.HostedTest.html

latest3.0 KB
Original Source

Package com.google.android.exoplayer2.testutil

Interface HostActivity.HostedTest

  • All Known Implementing Classes:ExoHostedTestEnclosing class:HostActivity

public static interfaceHostActivity.HostedTest

Interface for tests that run inside of a HostActivity.

Method Summary

All Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | blockUntilStopped​(long timeoutMs) | Called on the main thread to block until the test has stopped or forceStop() is called. | | boolean | forceStop() | Called on the main thread to force stop the test (if it is not stopped already). | | void | onFinished() | Called on the test thread after the test has finished and been stopped. | | void | onStart​(HostActivity host, Surface surface, FrameLayout overlayFrameLayout) | Called on the main thread when the test is started. |

Method Detail

- 

onStart

void onStart​([HostActivity](HostActivity.html "class in com.google.android.exoplayer2.testutil")host,[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface,[FrameLayout](https://developer.android.com/reference/android/widget/FrameLayout.html "class or interface in android.widget")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 Surface has been created.

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

- 

blockUntilStopped

boolean blockUntilStopped​(long timeoutMs)

Called on the main thread to block until the test has stopped or forceStop() is called. Parameters:timeoutMs - The maximum time to block in milliseconds.Returns:Whether the test has stopped successful.

- 

forceStop

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.

- 

onFinished

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.