Index: mojo/dart/apptest/apptest/apptest.dart |
diff --git a/mojo/dart/apptest/apptest/apptest.dart b/mojo/dart/apptest/apptest/apptest.dart |
index a50fde9bbfa37580ed3724aaeefb8323cf02a35a..a59759d44ddb28f19546e5cc719d34af8d340ad8 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. |