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

Unified Diff: mojo/dart/test/bindings_generation_test.dart

Issue 996923003: Dart: Better handle leak checks. close() is async. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge 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
« no previous file with comments | « mojo/dart/embedder/test/validation_unittest.cc ('k') | mojo/dart/test/interface_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/test/bindings_generation_test.dart
diff --git a/mojo/dart/test/bindings_generation_test.dart b/mojo/dart/test/bindings_generation_test.dart
index 6884c0e40123509597ae7ebf688e3f36899c94a2..7366ac1992ea674caf1e8759fea628d9485fc927 100644
--- a/mojo/dart/test/bindings_generation_test.dart
+++ b/mojo/dart/test/bindings_generation_test.dart
@@ -113,8 +113,25 @@ testSerializeStructs() {
testSerializeArrayValueTypes();
}
+void closingProviderIsolate(core.MojoMessagePipeEndpoint endpoint) {
+ var provider = new ProviderImpl(endpoint);
+ provider._stub.close();
+}
+
+Future<bool> runOnClosedTest() {
+ var testCompleter = new Completer();
+ var pipe = new core.MojoMessagePipe();
+ var proxy = new sample.ProviderProxy.fromEndpoint(pipe.endpoints[0]);
+ proxy.impl.onError = () => testCompleter.complete(true);
+ Isolate.spawn(closingProviderIsolate, pipe.endpoints[1]);
+ return testCompleter.future.then((b) {
+ Expect.isTrue(b);
+ });
+}
+
main() async {
testSerializeStructs();
await testCallResponse();
await testAwaitCallResponse();
+ await runOnClosedTest();
}
« no previous file with comments | « mojo/dart/embedder/test/validation_unittest.cc ('k') | mojo/dart/test/interface_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698