Index: lib/src/runner/runner_suite.dart |
diff --git a/lib/src/runner/runner_suite.dart b/lib/src/runner/runner_suite.dart |
index 589178ff7b3d3ebe6994ae76293e392b6b3a22b6..10064afe244a84c8fcda7b4e9f23c07c8307297a 100644 |
--- a/lib/src/runner/runner_suite.dart |
+++ b/lib/src/runner/runner_suite.dart |
@@ -6,12 +6,13 @@ library test.runner.runner_suite; |
import 'dart:async'; |
+import 'package:async/async.dart'; |
+ |
import '../backend/metadata.dart'; |
import '../backend/operating_system.dart'; |
import '../backend/suite.dart'; |
import '../backend/test.dart'; |
import '../backend/test_platform.dart'; |
-import '../util/async_thunk.dart'; |
import '../utils.dart'; |
/// A suite produced and consumed by the test runner that has runner-specific |
@@ -21,8 +22,8 @@ import '../utils.dart'; |
/// eventually become its own package) is primarily for test code itself to use, |
/// for which the [RunnerSuite] APIs don't make sense. |
class RunnerSuite extends Suite { |
- /// The thunk for running [close] exactly once. |
- final _closeThunk = new AsyncThunk(); |
+ /// The memoizer for running [close] exactly once. |
+ final _closeMemo = new AsyncMemoizer(); |
/// The function to call when the suite is closed. |
final AsyncFunction _onClose; |
@@ -52,7 +53,7 @@ class RunnerSuite extends Suite { |
/// Closes the suite and releases any resources associated with it. |
Future close() { |
- return _closeThunk.run(() async { |
+ return _closeMemo.runOnce(() async { |
if (_onClose != null) await _onClose(); |
}); |
} |