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

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

Issue 1414483010: Dart: Use a RawReceivePort to receive events for Mojo handles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 5 years, 1 month 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/test/validation_test.dart
diff --git a/mojo/dart/test/validation_test.dart b/mojo/dart/test/validation_test.dart
index 4de347aadb4a19b40c88839146ecdd92ea8db83e..77cc2091c89f399379768b74c947221d062ec2f9 100644
--- a/mojo/dart/test/validation_test.dart
+++ b/mojo/dart/test/validation_test.dart
@@ -22,6 +22,10 @@ class ConformanceTestInterfaceImpl implements ConformanceTestInterface {
_stub = new ConformanceTestInterfaceStub.fromEndpoint(endpoint, this);
}
+ set onError(Function f) {
+ _stub.onError = f;
+ }
+
void _complete() => _completer.complete(null);
method0(double param0) => _complete();
@@ -74,14 +78,13 @@ Future runTest(
var completer = new Completer();
var conformanceImpl;
- runZoned(() {
- conformanceImpl =
- new ConformanceTestInterfaceImpl(completer, pipe.endpoints[0]);
- }, onError: (e, stackTrace) {
+ conformanceImpl =
+ new ConformanceTestInterfaceImpl(completer, pipe.endpoints[0]);
+ conformanceImpl.onError = ((e) {
assert(e is MojoCodecError);
// TODO(zra): Make the error messages conform?
// assert(e == expected);
- conformanceImpl.close(immediate: true);
+ conformanceImpl.close();
pipe.endpoints[0].close();
pipe.endpoints[1].close();
handles.forEach((h) => h.close());
@@ -94,10 +97,11 @@ Future runTest(
return completer.future.then((_) {
Cutch 2015/11/11 17:47:17 ... (_) async {
zra 2015/11/11 18:44:33 Acknowledged.
assert(expected == "PASS");
- conformanceImpl.close();
- pipe.endpoints[0].close();
- pipe.endpoints[1].close();
- handles.forEach((h) => h.close());
+ conformanceImpl.close().then((_) {
Cutch 2015/11/11 17:47:17 await conformanceImpl.close(); ...
zra 2015/11/11 18:44:33 Changed to return instead of await since the resul
+ pipe.endpoints[0].close();
+ pipe.endpoints[1].close();
+ handles.forEach((h) => h.close());
+ });
}, onError: (e) {
// Do nothing.
});

Powered by Google App Engine
This is Rietveld 408576698