Package com.tomtom.ivi.platform.tools.api.testing.multidisplay

Types

Link copied to clipboard
class ActiveDisplayScope(displayId: DisplayId)

Scope which provides necessary data and useful routines for writing multi-display tests. It provides:

Link copied to clipboard
data class DisplayId(val id: Int)

Represents a display ID.

Link copied to clipboard
class OnDisplayContext(    val primaryActivityScenarioStateProvider: () -> Lifecycle.State,     val moveFocusToDisplay: (DisplayId) -> Unit,     val displayIdProvider: () -> DisplayId)

The context for onDisplay invocation.

Functions

Link copied to clipboard

Creates an OnDisplayContext for the primary display.

Link copied to clipboard
fun IviActivityTestCase.createSecondaryOnDisplayContext(displayIdProvider: () -> DisplayId): OnDisplayContext

Creates an OnDisplayContext for a secondary display. The display ID of the secondary display is provided by displayIdProvider.

Link copied to clipboard
fun finishPassengerActivity()

Force to finish passenger activity. Passenger activity will be destroyed before any other activities lifecycle status changes.

Launches debug menu activity on secondary display using debug menu on primary screen.

Launches passenger's activity on secondary display using debug menu.

Link copied to clipboard
fun moveFocusToPrimaryDisplayIviActivity()

Move focus to ivi activity on primary display.

Link copied to clipboard
fun moveFocusToSecondaryDisplayIviActivity(displayId: DisplayId)

Move focus to ivi activity on secondary display.

Link copied to clipboard
fun obtainSecondaryDisplayIds(): List<DisplayId>

Obtains the list of all available secondary displays. Throws IllegalStateException if there are no secondary displays available.

Link copied to clipboard
fun ActiveDisplayScope.onDisplay(action: ActiveDisplayScope.() -> Unit)

Prevents contraptions like:

fun onDisplay(context: OnDisplayContext, action: ActiveDisplayScope.() -> Unit)

Activates Activity on the display specified in context and introduces a scope for actions and assertions. Lambda action is supplied with ActiveDisplayScope as a receiver. In this lambda it is important to always use ActiveDisplayScope.rootMatcher when obtaining a ViewInteraction.

Link copied to clipboard
fun thatDoesNotMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to any non primary display. Convenient to use if you have primary and one secondary display only.

Link copied to clipboard
fun thatMatchesPrimaryDisplay(): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to primary display.

Link copied to clipboard
fun thatMatchesSpecificDisplay(displayId: DisplayId): TypeSafeMatcher<Root>

Returns a TypeSafeMatcher for Root which matches the root which belongs to display with the given displayId.