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

Unified Diff: pkg/analysis_server/test/channel_test.dart

Issue 195463004: update channel test per comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/channel_test.dart
diff --git a/pkg/analysis_server/test/channel_test.dart b/pkg/analysis_server/test/channel_test.dart
index 9658269b491e53387fe7ee92b02616800f2cf1dc..95a34b7caca497bd6612cbfbedca526814a302e6 100644
--- a/pkg/analysis_server/test/channel_test.dart
+++ b/pkg/analysis_server/test/channel_test.dart
@@ -61,20 +61,20 @@ class WebSocketChannelTest {
}
static Future invalidJsonToClient() {
- socket.twin.add('{"foo":"bar"}');
- server.sendResponse(new Response('myId'));
- return client.responseStream
+ var result = client.responseStream
.first
.timeout(new Duration(seconds: 1))
.then((Response response) {
expect(response.id, equals('myId'));
expectMsgCount(responseCount: 1);
});
+ socket.twin.add('{"foo":"bar"}');
+ server.sendResponse(new Response('myId'));
+ return result;
}
static Future invalidJsonToServer() {
- socket.add('"blat"');
- return client.responseStream
+ var result = client.responseStream
.first
.timeout(new Duration(seconds: 1))
.then((Response response) {
@@ -82,31 +82,34 @@ class WebSocketChannelTest {
expect(response.error, isNotNull);
expectMsgCount(responseCount: 1);
});
+ socket.add('"blat"');
+ return result;
}
static Future notification() {
- server.sendNotification(new Notification('myEvent'));
- return client.notificationStream
+ var result = client.notificationStream
.first
.timeout(new Duration(seconds: 1))
.then((Notification notification) {
expect(notification.event, equals('myEvent'));
expectMsgCount(notificationCount: 1);
-
expect(notificationsReceived.first, equals(notification));
});
+ server.sendNotification(new Notification('myEvent'));
+ return result;
}
static Future notificationAndResponse() {
- server
- ..sendNotification(new Notification('myEvent'))
- ..sendResponse(new Response('myId'));
- return Future
+ var result = Future
.wait([
client.notificationStream.first,
client.responseStream.first])
.timeout(new Duration(seconds: 1))
.then((_) => expectMsgCount(responseCount: 1, notificationCount: 1));
+ server
+ ..sendNotification(new Notification('myEvent'))
+ ..sendResponse(new Response('myId'));
+ return result;
}
static void request() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698