| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/protocol/protocol_constants.dart'; | 8 import 'package:analysis_server/protocol/protocol_constants.dart'; |
| 9 import 'package:analysis_server/protocol/protocol_generated.dart'; | 9 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 resourceProvider = new MemoryResourceProvider(); | 50 resourceProvider = new MemoryResourceProvider(); |
| 51 ServerPlugin serverPlugin = new ServerPlugin(); | 51 ServerPlugin serverPlugin = new ServerPlugin(); |
| 52 processRequiredPlugins(serverPlugin); | 52 processRequiredPlugins(serverPlugin); |
| 53 // Create an SDK in the mock file system. | 53 // Create an SDK in the mock file system. |
| 54 new MockSdk(resourceProvider: resourceProvider); | 54 new MockSdk(resourceProvider: resourceProvider); |
| 55 server = new AnalysisServer( | 55 server = new AnalysisServer( |
| 56 serverChannel, | 56 serverChannel, |
| 57 resourceProvider, | 57 resourceProvider, |
| 58 new MockPackageMapProvider(), | 58 new MockPackageMapProvider(), |
| 59 serverPlugin, | 59 serverPlugin, |
| 60 new AnalysisServerOptions(), | 60 new AnalysisServerOptions()..addMocks(), |
| 61 new DartSdkManager('/', false), | 61 new DartSdkManager('/', false), |
| 62 InstrumentationService.NULL_SERVICE); | 62 InstrumentationService.NULL_SERVICE); |
| 63 handler = new AnalysisDomainHandler(server); | 63 handler = new AnalysisDomainHandler(server); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 group('updateContent', testUpdateContent); | 66 group('updateContent', testUpdateContent); |
| 67 | 67 |
| 68 group('AnalysisDomainHandler', () { | 68 group('AnalysisDomainHandler', () { |
| 69 // TODO(brianwilkerson) Re-enable these tests if we re-enable the | 69 // TODO(brianwilkerson) Re-enable these tests if we re-enable the |
| 70 // analysis.getReachableSources request. | 70 // analysis.getReachableSources request. |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 processRequiredPlugins(serverPlugin); | 437 processRequiredPlugins(serverPlugin); |
| 438 serverChannel = new MockServerChannel(); | 438 serverChannel = new MockServerChannel(); |
| 439 resourceProvider = new MemoryResourceProvider(); | 439 resourceProvider = new MemoryResourceProvider(); |
| 440 // Create an SDK in the mock file system. | 440 // Create an SDK in the mock file system. |
| 441 new MockSdk(resourceProvider: resourceProvider); | 441 new MockSdk(resourceProvider: resourceProvider); |
| 442 server = new AnalysisServer( | 442 server = new AnalysisServer( |
| 443 serverChannel, | 443 serverChannel, |
| 444 resourceProvider, | 444 resourceProvider, |
| 445 new MockPackageMapProvider(), | 445 new MockPackageMapProvider(), |
| 446 serverPlugin, | 446 serverPlugin, |
| 447 new AnalysisServerOptions(), | 447 new AnalysisServerOptions()..addMocks(), |
| 448 new DartSdkManager('/', false), | 448 new DartSdkManager('/', false), |
| 449 InstrumentationService.NULL_SERVICE); | 449 InstrumentationService.NULL_SERVICE); |
| 450 handler = new AnalysisDomainHandler(server); | 450 handler = new AnalysisDomainHandler(server); |
| 451 // listen for notifications | 451 // listen for notifications |
| 452 Stream<Notification> notificationStream = | 452 Stream<Notification> notificationStream = |
| 453 serverChannel.notificationController.stream; | 453 serverChannel.notificationController.stream; |
| 454 notificationStream.listen((Notification notification) { | 454 notificationStream.listen((Notification notification) { |
| 455 if (notification.event == ANALYSIS_NOTIFICATION_ERRORS) { | 455 if (notification.event == ANALYSIS_NOTIFICATION_ERRORS) { |
| 456 var decoded = new AnalysisErrorsParams.fromNotification(notification); | 456 var decoded = new AnalysisErrorsParams.fromNotification(notification); |
| 457 filesErrors[decoded.file] = decoded.errors; | 457 filesErrors[decoded.file] = decoded.errors; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 plugin.AnalysisSetSubscriptionsParams params = | 805 plugin.AnalysisSetSubscriptionsParams params = |
| 806 pluginManager.analysisSetSubscriptionsParams; | 806 pluginManager.analysisSetSubscriptionsParams; |
| 807 expect(params, isNotNull); | 807 expect(params, isNotNull); |
| 808 Map<plugin.AnalysisService, List<String>> subscriptions = | 808 Map<plugin.AnalysisService, List<String>> subscriptions = |
| 809 params.subscriptions; | 809 params.subscriptions; |
| 810 expect(subscriptions, hasLength(1)); | 810 expect(subscriptions, hasLength(1)); |
| 811 List<String> files = subscriptions[plugin.AnalysisService.HIGHLIGHTS]; | 811 List<String> files = subscriptions[plugin.AnalysisService.HIGHLIGHTS]; |
| 812 expect(files, [testFile]); | 812 expect(files, [testFile]); |
| 813 } | 813 } |
| 814 } | 814 } |
| OLD | NEW |