| 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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 serverChannel = new MockServerChannel(); | 38 serverChannel = new MockServerChannel(); |
| 39 resourceProvider = new MemoryResourceProvider(); | 39 resourceProvider = new MemoryResourceProvider(); |
| 40 ExtensionManager manager = new ExtensionManager(); | 40 ExtensionManager manager = new ExtensionManager(); |
| 41 ServerPlugin serverPlugin = new ServerPlugin(); | 41 ServerPlugin serverPlugin = new ServerPlugin(); |
| 42 manager.processPlugins([serverPlugin]); | 42 manager.processPlugins([serverPlugin]); |
| 43 server = new AnalysisServer( | 43 server = new AnalysisServer( |
| 44 serverChannel, | 44 serverChannel, |
| 45 resourceProvider, | 45 resourceProvider, |
| 46 new MockPackageMapProvider(), | 46 new MockPackageMapProvider(), |
| 47 null, | 47 null, |
| 48 null, |
| 48 serverPlugin, | 49 serverPlugin, |
| 49 new AnalysisServerOptions(), | 50 new AnalysisServerOptions(), |
| 50 () => new MockSdk(), | 51 () => new MockSdk(), |
| 51 InstrumentationService.NULL_SERVICE); | 52 InstrumentationService.NULL_SERVICE); |
| 52 handler = new AnalysisDomainHandler(server); | 53 handler = new AnalysisDomainHandler(server); |
| 53 }); | 54 }); |
| 54 | 55 |
| 55 group('updateContent', testUpdateContent); | 56 group('updateContent', testUpdateContent); |
| 56 | 57 |
| 57 group('AnalysisDomainHandler', () { | 58 group('AnalysisDomainHandler', () { |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 serverChannel = new MockServerChannel(); | 466 serverChannel = new MockServerChannel(); |
| 466 resourceProvider = new MemoryResourceProvider(); | 467 resourceProvider = new MemoryResourceProvider(); |
| 467 ExtensionManager manager = new ExtensionManager(); | 468 ExtensionManager manager = new ExtensionManager(); |
| 468 ServerPlugin serverPlugin = new ServerPlugin(); | 469 ServerPlugin serverPlugin = new ServerPlugin(); |
| 469 manager.processPlugins([serverPlugin]); | 470 manager.processPlugins([serverPlugin]); |
| 470 server = new AnalysisServer( | 471 server = new AnalysisServer( |
| 471 serverChannel, | 472 serverChannel, |
| 472 resourceProvider, | 473 resourceProvider, |
| 473 new MockPackageMapProvider(), | 474 new MockPackageMapProvider(), |
| 474 null, | 475 null, |
| 476 null, |
| 475 serverPlugin, | 477 serverPlugin, |
| 476 new AnalysisServerOptions(), | 478 new AnalysisServerOptions(), |
| 477 () => new MockSdk(), | 479 () => new MockSdk(), |
| 478 InstrumentationService.NULL_SERVICE); | 480 InstrumentationService.NULL_SERVICE); |
| 479 handler = new AnalysisDomainHandler(server); | 481 handler = new AnalysisDomainHandler(server); |
| 480 // listen for notifications | 482 // listen for notifications |
| 481 Stream<Notification> notificationStream = | 483 Stream<Notification> notificationStream = |
| 482 serverChannel.notificationController.stream; | 484 serverChannel.notificationController.stream; |
| 483 notificationStream.listen((Notification notification) { | 485 notificationStream.listen((Notification notification) { |
| 484 if (notification.event == ANALYSIS_ERRORS) { | 486 if (notification.event == ANALYSIS_ERRORS) { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 test_beforeAnalysis() async { | 810 test_beforeAnalysis() async { |
| 809 addTestFile('int V = 42;'); | 811 addTestFile('int V = 42;'); |
| 810 createProject(); | 812 createProject(); |
| 811 // subscribe | 813 // subscribe |
| 812 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); | 814 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); |
| 813 // wait for analysis | 815 // wait for analysis |
| 814 await waitForTasksFinished(); | 816 await waitForTasksFinished(); |
| 815 expect(filesHighlights[testFile], isNotEmpty); | 817 expect(filesHighlights[testFile], isNotEmpty); |
| 816 } | 818 } |
| 817 } | 819 } |
| OLD | NEW |