OLD | NEW |
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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/channel/web_socket_channel.dart'; | 10 import 'package:analysis_server/src/channel/web_socket_channel.dart'; |
11 import 'package:analyzer/instrumentation/instrumentation.dart'; | 11 import 'package:analyzer/instrumentation/instrumentation.dart'; |
12 import 'package:unittest/unittest.dart'; | 12 import 'package:test/test.dart'; |
13 | 13 |
14 import '../mocks.dart'; | 14 import '../mocks.dart'; |
15 import '../utils.dart'; | 15 import '../utils.dart'; |
16 | 16 |
17 main() { | 17 main() { |
18 initializeTestEnvironment(); | 18 initializeTestEnvironment(); |
19 group('WebSocketChannel', () { | 19 group('WebSocketChannel', () { |
20 setUp(WebSocketChannelTest.setUp); | 20 setUp(WebSocketChannelTest.setUp); |
21 test('close', WebSocketChannelTest.close); | 21 test('close', WebSocketChannelTest.close); |
22 test('invalidJsonToClient', WebSocketChannelTest.invalidJsonToClient); | 22 test('invalidJsonToClient', WebSocketChannelTest.invalidJsonToClient); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 notificationsReceived = <Notification>[]; | 149 notificationsReceived = <Notification>[]; |
150 | 150 |
151 // Allow multiple listeners on server side for testing. | 151 // Allow multiple listeners on server side for testing. |
152 socket.twin.allowMultipleListeners(); | 152 socket.twin.allowMultipleListeners(); |
153 | 153 |
154 server.listen(requestsReceived.add); | 154 server.listen(requestsReceived.add); |
155 client.responseStream.listen(responsesReceived.add); | 155 client.responseStream.listen(responsesReceived.add); |
156 client.notificationStream.listen(notificationsReceived.add); | 156 client.notificationStream.listen(notificationsReceived.add); |
157 } | 157 } |
158 } | 158 } |
OLD | NEW |