| Index: mojo/dart/apptests/test_apps/echo/lib/main.dart
|
| diff --git a/mojo/dart/apptests/test_apps/echo/lib/main.dart b/mojo/dart/apptests/test_apps/echo/lib/main.dart
|
| index fba41a7275a1e31a1a7a904da6f45aa3a22f479b..4ace20ac1e70d7281482d1051c7bd2c6d68358c0 100644
|
| --- a/mojo/dart/apptests/test_apps/echo/lib/main.dart
|
| +++ b/mojo/dart/apptests/test_apps/echo/lib/main.dart
|
| @@ -33,7 +33,22 @@ class EchoServiceImpl implements EchoService {
|
| new Duration(milliseconds: millis), () => responseFactory(value));
|
| }
|
|
|
| + void swap() {
|
| + _swapImpls(this);
|
| + }
|
| +
|
| void quit() {}
|
| +
|
| + static void _swapImpls(EchoServiceImpl impl) {
|
| + final stub = impl._stub;
|
| + final app = impl._application;
|
| + // It is not allowed to do an unbind in the midst of handling an event, so
|
| + // it is delayed until popping back out to the event loop.
|
| + Timer.run(() {
|
| + final endpoint = stub.unbind();
|
| + new EchoServiceImpl(app, endpoint);
|
| + });
|
| + }
|
| }
|
|
|
| class EchoApplication extends Application {
|
|
|