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

Unified Diff: tests/isolate/ping_test.dart

Issue 749373002: - Implement Isolate.ping. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« runtime/vm/message_test.cc ('K') | « tests/isolate/isolate.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/isolate/ping_test.dart
===================================================================
--- tests/isolate/ping_test.dart (revision 41942)
+++ tests/isolate/ping_test.dart (working copy)
@@ -24,6 +24,10 @@
List result = [];
completer.future.then((echoPort) {
reply.handler = (v) {
+ if (result.isEmpty) {
+ // Prevent messages overtaking each other on delivery.
+ echoPort.send(0);
+ }
result.add(v);
if (v == 0) {
Expect.listEquals(["alive", "control", "event"],
@@ -38,7 +42,7 @@
"control index < 2");
int eventIndex = result.indexOf("event");
Expect.isTrue(eventIndex > result.indexOf(2), "event index > 2");
- Expect.isTrue(eventIndex < result.indexOf(1), "event index < 1");
+ Expect.isTrue(eventIndex < result.indexOf(0), "event index < 0");
reply.close();
asyncEnd();
}
@@ -58,7 +62,6 @@
echoPort.send(2);
isolate.ping(createPingPort("event"), Isolate.AS_EVENT);
echoPort.send(1);
- echoPort.send(0);
});
});
}
« runtime/vm/message_test.cc ('K') | « tests/isolate/isolate.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698