OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io' as io; | 6 import 'dart:io' as io; |
7 | 7 |
8 import 'package:analysis_server/src/plugin/notification_manager.dart'; | 8 import 'package:analysis_server/src/plugin/notification_manager.dart'; |
9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; | 9 import 'package:analysis_server/src/plugin/plugin_manager.dart'; |
10 import 'package:analyzer/context/context_root.dart'; | 10 import 'package:analyzer/context/context_root.dart'; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 void test_handleOnError() { | 440 void test_handleOnError() { |
441 session.handleOnError(<String>['message', 'trace']); | 441 session.handleOnError(<String>['message', 'trace']); |
442 fail('The method handleOnError is not implemented'); | 442 fail('The method handleOnError is not implemented'); |
443 } | 443 } |
444 | 444 |
445 test_handleResponse() async { | 445 test_handleResponse() async { |
446 new TestServerCommunicationChannel(session); | 446 new TestServerCommunicationChannel(session); |
447 Response response = new PluginVersionCheckResult( | 447 Response response = new PluginVersionCheckResult( |
448 true, 'name', 'version', <String>[], | 448 true, 'name', 'version', <String>[], |
449 contactInfo: 'contactInfo') | 449 contactInfo: 'contactInfo') |
450 .toResponse('0'); | 450 .toResponse('0', 1); |
451 Future<Response> future = | 451 Future<Response> future = |
452 session.sendRequest(new PluginVersionCheckParams('', '', '')); | 452 session.sendRequest(new PluginVersionCheckParams('', '', '')); |
453 expect(session.pendingRequests, hasLength(1)); | 453 expect(session.pendingRequests, hasLength(1)); |
454 session.handleResponse(response); | 454 session.handleResponse(response); |
455 expect(session.pendingRequests, hasLength(0)); | 455 expect(session.pendingRequests, hasLength(0)); |
456 Response result = await future; | 456 Response result = await future; |
457 expect(result, same(response)); | 457 expect(result, same(response)); |
458 } | 458 } |
459 | 459 |
460 void test_nextRequestId() { | 460 void test_nextRequestId() { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 void onNotification(Notification notification), | 688 void onNotification(Notification notification), |
689 {Function onError, void onDone()}) { | 689 {Function onError, void onDone()}) { |
690 fail('Unexpected invocation of listen'); | 690 fail('Unexpected invocation of listen'); |
691 } | 691 } |
692 | 692 |
693 @override | 693 @override |
694 void sendRequest(Request request) { | 694 void sendRequest(Request request) { |
695 sentRequests.add(request); | 695 sentRequests.add(request); |
696 } | 696 } |
697 } | 697 } |
OLD | NEW |