ActivityEmbeddingRule


class ActivityEmbeddingRule : TestRule


A TestRule that will stub out the behavior of ActivityEmbeddingController and RuleController with a more simple one that will support testing independent of the current platform.

By default ActivityEmbeddingRule has values as if the developer has not opted in to the ActivityEmbedding feature. There are no set rules, and each Activity is not embedded.

Summary

Public constructors

Public functions

open Statement
apply(base: Statement, description: Description)
Unit
overrideIsActivityEmbedded(
    activity: Activity,
    isActivityEmbedded: Boolean
)

Overrides the return value of ActivityEmbeddingController.isActivityEmbedded.

Unit
overrideSplitInfo(activity: Activity, splitInfoList: List<SplitInfo>)

Overrides current split info reported by SplitController.splitInfoList.

Unit

Overrides the return value of SplitController.splitSupportStatus.

Public constructors

ActivityEmbeddingRule

Added in 1.2.0
ActivityEmbeddingRule()

Public functions

apply

Added in 1.2.0
open fun apply(base: Statement, description: Description): Statement

overrideIsActivityEmbedded

Added in 1.2.0
fun overrideIsActivityEmbedded(
    activity: Activity,
    isActivityEmbedded: Boolean
): Unit

Overrides the return value of ActivityEmbeddingController.isActivityEmbedded.

Parameters
activity: Activity

Activity that will be passed to ActivityEmbeddingController.isActivityEmbedded.

isActivityEmbedded: Boolean

whether ActivityEmbeddingController.isActivityEmbedded should return true for the activity.

overrideSplitInfo

Added in 1.2.0
fun overrideSplitInfo(activity: Activity, splitInfoList: List<SplitInfo>): Unit

Overrides current split info reported by SplitController.splitInfoList. The initial override value is set to an empty List.

Parameters
activity: Activity

the Activity corresponding to the splitInfoList.

splitInfoList: List<SplitInfo>

a list of SplitInfo that will be emitted through SplitController.splitInfoList.

overrideSplitSupportStatus

Added in 1.2.0
fun overrideSplitSupportStatus(status: SplitController.SplitSupportStatus): Unit

Overrides the return value of SplitController.splitSupportStatus.

Parameters
status: SplitController.SplitSupportStatus

the global SplitController.SplitSupportStatus that will be returned instead.