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

Unified Diff: mojo/dart/apptests/test_apps/pingpong/lib/main.dart

Issue 1948003003: Dart: Wait to handle events on a Stub until it makes sense to do it. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add test Created 4 years, 7 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/apptests/test_apps/pingpong/lib/main.dart
diff --git a/mojo/dart/apptests/test_apps/pingpong/lib/main.dart b/mojo/dart/apptests/test_apps/pingpong/lib/main.dart
index 8202a82cbc9b7ea3a35126e2e2dd4f27e1fb0464..1e0ff6f3bb51e25b2612c2f383120e75244022d8 100644
--- a/mojo/dart/apptests/test_apps/pingpong/lib/main.dart
+++ b/mojo/dart/apptests/test_apps/pingpong/lib/main.dart
@@ -100,6 +100,23 @@ class PingPongServiceImpl implements PingPongService {
targetServiceProxy.close();
}
+ getPingPongServiceDelayed(PingPongServiceStub serviceStub) {
+ Timer.run(() {
+ var endpoint = serviceStub.unbind();
+ new Timer(const Duration(milliseconds: 10), () {
+ var targetServiceProxy = new PingPongServiceProxy.unbound();
+ _application.connectToService(
+ "mojo:dart_pingpong_target", targetServiceProxy);
+
+ // Pass along the interface request to another implementation of the
+ // service.
+ serviceStub.bind(endpoint);
+ targetServiceProxy.ptr.getPingPongService(serviceStub);
+ targetServiceProxy.close();
+ });
+ });
+ }
+
void quit() {}
}

Powered by Google App Engine
This is Rietveld 408576698