FakePenSession
class FakePenSession(commitHandler: suspend (bitmap: Bitmap, destination: Rect, dirtyRegion: Rect, options: CommitOptions) -> Result<CommitReceipt> = { _, _, _, _ ->
Result.failure(
OnyxFailure.UnsupportedCapability(
"fake.commit",
null,
"No commit result was configured for FakePenSession",
),
)
}) : PenSession(source)
Deterministic consumer-facing test double; it performs no Android firmware calls.
Constructors
Link copied to clipboard
constructor(commitHandler: suspend (bitmap: Bitmap, destination: Rect, dirtyRegion: Rect, options: CommitOptions) -> Result<CommitReceipt> = { _, _, _, _ ->
Result.failure(
OnyxFailure.UnsupportedCapability(
"fake.commit",
null,
"No commit result was configured for FakePenSession",
),
)
})
Properties
Link copied to clipboard
Strokes injected through emit.
Link copied to clipboard
Latest preview derived from injected pen events.
Link copied to clipboard
Mutable test state exposed as the production session contract.
Functions
Link copied to clipboard
Closes the fake synchronously and returns success.
Link copied to clipboard
open suspend override fun commit(bitmap: Bitmap, destination: Rect, dirtyRegion: Rect = destination, options: CommitOptions = CommitOptions()): Result<CommitReceipt>
Delegates a commit to the handler supplied at construction time.