diff --git a/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart b/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart index 569ef60b4..875afe188 100644 --- a/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart +++ b/pkgs/test_core/lib/src/runner/plugin/platform_helpers.dart @@ -43,7 +43,8 @@ RunnerSuiteController deserializeSuite( Environment environment, StreamChannel channel, Object /*Map*/ message, - {Future> Function()? gatherCoverage}) { + {Future> Function()? gatherCoverage, + Future Function()? onDone}) { var disconnector = Disconnector(); var suiteChannel = MultiChannel(channel.transform(disconnector)); @@ -118,7 +119,10 @@ RunnerSuiteController deserializeSuite( return RunnerSuiteController( environment, suiteConfig, suiteChannel, completer.future, platform, path: path, - onClose: () => disconnector.disconnect().onError(handleError), + onClose: () => [ + disconnector.disconnect().onError(handleError), + if (onDone != null) onDone(), + ].wait, gatherCoverage: gatherCoverage); }