Index: mojo/dart/apptest/apptest/apptest.dart |
diff --git a/mojo/dart/apptest/apptest/apptest.dart b/mojo/dart/apptest/apptest/apptest.dart |
index a3ae6a9b500edb26980d19cc2ae8a4929b6b3166..930d32555cae89c78d244e9f7f6a0dd690415137 100644 |
--- a/mojo/dart/apptest/apptest/apptest.dart |
+++ b/mojo/dart/apptest/apptest/apptest.dart |
@@ -19,8 +19,8 @@ export 'package:unittest/unittest.dart'; |
class _ConnectionToShellApplication extends Application { |
final List<Function> _testFunctions; |
- _ConnectionToShellApplication.fromHandle(MojoHandle handle, |
- this._testFunctions) |
+ _ConnectionToShellApplication.fromHandle( |
+ MojoHandle handle, this._testFunctions) |
: super.fromHandle(handle); |
// Only run the test suite passed in once we have received an initialize() |
@@ -45,9 +45,14 @@ class _CleanShutdownConfiguration extends SimpleConfiguration { |
} |
void onDone(bool success) { |
- _application.close(); |
+ closeApplication(); |
super.onDone(success); |
} |
+ |
+ Future closeApplication() async { |
+ await _application.close(); |
+ assert(MojoHandle.reportLeakedHandles()); |
+ } |
} |
// The public interface to apptests. |