TestLocationButtonProvider


open class TestLocationButtonProvider : LocationButtonProvider


A test implementation of LocationButtonProvider which provides a fake of the LocationButton and provides additional methods to allow tests to fake user interactions so that the client side flows can be tested.

Summary

Public companion functions

TestLocationButtonProvider

Construct a TestLocationButtonProvider that runs a fake location button session.

Public constructors

Public functions

Unit
notifyPermissionResult(
    session: LocationButtonSession,
    isGranted: Boolean
)
open Unit
openSession(
    activity: Activity,
    hostToken: IBinder,
    displayId: Int,
    request: LocationButtonRequest,
    executor: Executor,
    client: LocationButtonClient
)

Protected functions

open Unit

Public companion functions

create

Added in 1.0.0-alpha01
fun create(): TestLocationButtonProvider

Construct a TestLocationButtonProvider that runs a fake location button session.

Returns
TestLocationButtonProvider

A test only implementation of LocationButtonProvider.

Public constructors

TestLocationButtonProvider

Added in 1.0.0-alpha01
TestLocationButtonProvider(context: Context)

Public functions

notifyPermissionResult

Added in 1.0.0-alpha01
fun notifyPermissionResult(
    session: LocationButtonSession,
    isGranted: Boolean
): Unit

openSession

Added in 1.0.0-alpha01
open fun openSession(
    activity: Activity,
    hostToken: IBinder,
    displayId: Int,
    request: LocationButtonRequest,
    executor: Executor,
    client: LocationButtonClient
): Unit

Protected functions

onSessionRequestReceived

Added in 1.0.0-alpha01
protected open fun onSessionRequestReceived(
    request: LocationButtonRequest,
    session: LocationButtonSession
): Unit