| 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.domain.analysis; | 5 library test.domain.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 AnalysisDomainHandler handler; | 31 AnalysisDomainHandler handler; |
| 32 | 32 |
| 33 setUp(() { | 33 setUp(() { |
| 34 serverChannel = new MockServerChannel(); | 34 serverChannel = new MockServerChannel(); |
| 35 resourceProvider = new MemoryResourceProvider(); | 35 resourceProvider = new MemoryResourceProvider(); |
| 36 server = new AnalysisServer( | 36 server = new AnalysisServer( |
| 37 serverChannel, | 37 serverChannel, |
| 38 resourceProvider, | 38 resourceProvider, |
| 39 new MockPackageMapProvider(), | 39 new MockPackageMapProvider(), |
| 40 null, | 40 null, |
| 41 new AnalysisServerOptions(), |
| 41 new MockSdk()); | 42 new MockSdk()); |
| 42 handler = new AnalysisDomainHandler(server); | 43 handler = new AnalysisDomainHandler(server); |
| 43 }); | 44 }); |
| 44 | 45 |
| 45 group('updateContent', testUpdateContent); | 46 group('updateContent', testUpdateContent); |
| 46 group('setSubscriptions', test_setSubscriptions); | 47 group('setSubscriptions', test_setSubscriptions); |
| 47 | 48 |
| 48 group('AnalysisDomainHandler', () { | 49 group('AnalysisDomainHandler', () { |
| 49 group('setAnalysisRoots', () { | 50 group('setAnalysisRoots', () { |
| 50 Response testSetAnalysisRoots(List<String> included, | 51 Response testSetAnalysisRoots(List<String> included, |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 String testCode; | 453 String testCode; |
| 453 | 454 |
| 454 AnalysisTestHelper() { | 455 AnalysisTestHelper() { |
| 455 serverChannel = new MockServerChannel(); | 456 serverChannel = new MockServerChannel(); |
| 456 resourceProvider = new MemoryResourceProvider(); | 457 resourceProvider = new MemoryResourceProvider(); |
| 457 server = new AnalysisServer( | 458 server = new AnalysisServer( |
| 458 serverChannel, | 459 serverChannel, |
| 459 resourceProvider, | 460 resourceProvider, |
| 460 new MockPackageMapProvider(), | 461 new MockPackageMapProvider(), |
| 461 null, | 462 null, |
| 463 new AnalysisServerOptions(), |
| 462 new MockSdk()); | 464 new MockSdk()); |
| 463 handler = new AnalysisDomainHandler(server); | 465 handler = new AnalysisDomainHandler(server); |
| 464 // listen for notifications | 466 // listen for notifications |
| 465 Stream<Notification> notificationStream = | 467 Stream<Notification> notificationStream = |
| 466 serverChannel.notificationController.stream; | 468 serverChannel.notificationController.stream; |
| 467 notificationStream.listen((Notification notification) { | 469 notificationStream.listen((Notification notification) { |
| 468 if (notification.event == ANALYSIS_ERRORS) { | 470 if (notification.event == ANALYSIS_ERRORS) { |
| 469 var decoded = new AnalysisErrorsParams.fromNotification(notification); | 471 var decoded = new AnalysisErrorsParams.fromNotification(notification); |
| 470 filesErrors[decoded.file] = decoded.errors; | 472 filesErrors[decoded.file] = decoded.errors; |
| 471 } | 473 } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 return waitForServerOperationsPerformed(server); | 637 return waitForServerOperationsPerformed(server); |
| 636 } | 638 } |
| 637 | 639 |
| 638 static String _getCodeString(code) { | 640 static String _getCodeString(code) { |
| 639 if (code is List<String>) { | 641 if (code is List<String>) { |
| 640 code = code.join('\n'); | 642 code = code.join('\n'); |
| 641 } | 643 } |
| 642 return code as String; | 644 return code as String; |
| 643 } | 645 } |
| 644 } | 646 } |
| OLD | NEW |