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

Unified Diff: mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart

Issue 1874553002: Dart: Fix bug in unbind() for Stubs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | mojo/dart/apptests/test_apps/echo/lib/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart
diff --git a/mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart b/mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart
index 3c8b93f3912521bf73c19e333783c1cc14793ca1..a873ecd1715ee5086c26c90acae50315d8e05b1c 100644
--- a/mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart
+++ b/mojo/dart/apptests/dart_apptests/lib/src/echo_apptests.dart
@@ -86,6 +86,37 @@ echoApptests(Application application, String url) {
new Duration(milliseconds: 10), () => echoProxy.close());
});
+ test('Swap', () async {
+ var echoProxy =
+ new EchoServiceProxy.connectToService(application, "mojo:dart_echo");
+
+ for (int i = 0; i < 10; i++) {
+ var v =
+ await echoProxy.responseOrError(echoProxy.ptr.echoString("foo"));
+ expect(v.value, equals("foo"));
+ }
+
+ echoProxy.impl.errorFuture.then((e) {
+ fail("echoProxy: $e");
+ });
+
+ // Trigger an implementation swap in the echo server.
+ echoProxy.ptr.swap();
+
+ expect(echoProxy.impl.isBound, isTrue);
+
+ for (int i = 0; i < 10; i++) {
+ var v =
+ await echoProxy.responseOrError(echoProxy.ptr.echoString("foo"));
+ expect(v.value, equals("foo"));
+ }
+
+ var q = await echoProxy.responseOrError(echoProxy.ptr.echoString("quit"));
+ expect(q.value, equals("quit"));
+
+ await echoProxy.close();
+ });
+
test('Multiple Error Checks Success', () {
var echoProxy =
new EchoServiceProxy.connectToService(application, "mojo:dart_echo");
« no previous file with comments | « no previous file | mojo/dart/apptests/test_apps/echo/lib/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698