Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: mojo/dart/apptest/apptest/apptest.dart

Issue 996923003: Dart: Better handle leak checks. close() is async. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix regexes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698