run<R> method

  1. @visibleForTesting
R run<R>(
  1. R testCode()
)

Runs testCode with this platform as the current platform.

While testCode is running, the Platform.current refers to this platform object.

Prior reads of Platform.current will retain their original value, so the testCode should make sure to read Platform.current when it's needed, and not rely on previously read values.

Implementation

@visibleForTesting
R run<R>(R Function() testCode) =>
    overrides.runWith(testCode, this, _OverrideMarker.marker);