Hooks for an app's tests and for end-to-end harnesses. Not for production code.
reset stops the SDK and undoes everything it installed, for a test that
ran GroundcoverRum.init.
The session hooks change the persisted session state that the SDK reads when it starts, so their effect shows on the next launch, exactly as it would in the field, and no harness depends on the SDK's storage keys. Each completes once the write has settled.
The native hooks (triggerTestCrash, blockMainThread) work in development builds only: a simulator or a provisioned build on iOS, a debuggable app on Android. Anywhere else they do nothing, and they never throw into the caller: with no plugin to answer them (a widget test, a desktop build) they do nothing too.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
backdateLastActivity(
Duration by) → Future< void> -
Moves the last-activity time
byinto the past. Past 30 minutes, the next launch starts a new session. -
backdateSessionStart(
Duration by) → Future< void> -
Moves the session start
byinto the past. PastsessionMaxDuration, the next launch starts a new session. -
blockMainThread(
Duration duration) → Future< void> -
Blocks the main thread, where Dart runs too, for
durationand at most 30 seconds, so the hang watchdog fires. Completes before the block, which is posted to the main thread. -
forgetSession(
) → Future< void> - Forgets the persisted session: its id, start, last activity and sampling verdict. The next launch starts a session that has not yet seen a user.
-
reset(
) → Future< void> -
Stops the SDK and undoes everything it installed, so a widget or
integration test can end cleanly: Flutter's test binding fails a test
that leaves timers running or
debugPrintreplaced. Call it at the end of atestWidgetsbody: the binding checks beforetearDownruns. In a plaintest,tearDownworks too. A laterGroundcoverRum.initstarts afresh. -
triggerTestCrash(
[String kind = 'native']) → Future< void> -
Crashes the app natively: a segmentation fault on iOS, an uncaught
IllegalStateExceptionon Android's main thread.kindtravels in the Android message. Completes before the crash, which is posted to the main thread.