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

Unified Diff: mojo/dart/test/simple_handle_watcher_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/simple_handle_watcher_test.dart
diff --git a/mojo/dart/test/simple_handle_watcher_test.dart b/mojo/dart/test/simple_handle_watcher_test.dart
index d8456ded7ba772cfa6431d4bc9bbaa75dd38c400..543d6e725bac04766fa20437b47a34e86af4f343 100644
--- a/mojo/dart/test/simple_handle_watcher_test.dart
+++ b/mojo/dart/test/simple_handle_watcher_test.dart
@@ -14,17 +14,17 @@ main() {
var endpoint = pipe.endpoints[0];
assert(endpoint.handle.isValid);
- var eventStream = new core.MojoEventStream(endpoint.handle);
+ var eventHandler = new core.MojoEventHandler(endpoint.handle);
var completer = new Completer();
int numEvents = 0;
- eventStream.listen((_) {
+ eventHandler.handleEvents((_) {
numEvents++;
- eventStream.close();
- }, onDone: () {
- completer.complete(numEvents);
+ eventHandler.close().then((_) {
+ completer.complete(numEvents);
+ });
});
- eventStream.enableWriteEvents();
+ eventHandler.enableWriteEvents();
completer.future.then((int numEvents) {
assert(numEvents == 1);

Powered by Google App Engine
This is Rietveld 408576698