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

Side by Side Diff: pkg/analysis_server/test/channel/web_socket_channel_test.dart

Issue 790063002: Instrument communications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/test/channel/byte_stream_channel_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.channel.web_socket; 5 library test.channel.web_socket;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/channel/web_socket_channel.dart'; 9 import 'package:analysis_server/src/channel/web_socket_channel.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
11 import 'package:analyzer/instrumentation/instrumentation.dart';
11 import 'package:unittest/unittest.dart'; 12 import 'package:unittest/unittest.dart';
12 13
13 import '../mocks.dart'; 14 import '../mocks.dart';
14 15
15 main() { 16 main() {
16 group('WebSocketChannel', () { 17 group('WebSocketChannel', () {
17 setUp(WebSocketChannelTest.setUp); 18 setUp(WebSocketChannelTest.setUp);
18 test('close', WebSocketChannelTest.close); 19 test('close', WebSocketChannelTest.close);
19 test('invalidJsonToClient', WebSocketChannelTest.invalidJsonToClient); 20 test('invalidJsonToClient', WebSocketChannelTest.invalidJsonToClient);
20 test('invalidJsonToServer', WebSocketChannelTest.invalidJsonToServer); 21 test('invalidJsonToServer', WebSocketChannelTest.invalidJsonToServer);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 return client.responseStream.first.timeout( 132 return client.responseStream.first.timeout(
132 new Duration(seconds: 1)).then((Response response) { 133 new Duration(seconds: 1)).then((Response response) {
133 expect(response.id, equals('myId')); 134 expect(response.id, equals('myId'));
134 expectMsgCount(responseCount: 1); 135 expectMsgCount(responseCount: 1);
135 }); 136 });
136 } 137 }
137 138
138 static void setUp() { 139 static void setUp() {
139 socket = new MockSocket.pair(); 140 socket = new MockSocket.pair();
140 client = new WebSocketClientChannel(socket); 141 client = new WebSocketClientChannel(socket);
141 server = new WebSocketServerChannel(socket.twin); 142 server =
143 new WebSocketServerChannel(socket.twin, new NullInstrumentationServer()) ;
142 144
143 requestsReceived = []; 145 requestsReceived = [];
144 responsesReceived = []; 146 responsesReceived = [];
145 notificationsReceived = []; 147 notificationsReceived = [];
146 148
147 // Allow multiple listeners on server side for testing. 149 // Allow multiple listeners on server side for testing.
148 socket.twin.allowMultipleListeners(); 150 socket.twin.allowMultipleListeners();
149 151
150 server.listen(requestsReceived.add); 152 server.listen(requestsReceived.add);
151 client.responseStream.listen(responsesReceived.add); 153 client.responseStream.listen(responsesReceived.add);
152 client.notificationStream.listen(notificationsReceived.add); 154 client.notificationStream.listen(notificationsReceived.add);
153 } 155 }
154 } 156 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/channel/byte_stream_channel_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698