| 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.completion; | 5 library test.domain.completion; |
| 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/channel/channel.dart'; | 10 import 'package:analysis_server/src/channel/channel.dart'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 import 'mock_sdk.dart'; | 29 import 'mock_sdk.dart'; |
| 30 import 'mocks.dart'; | 30 import 'mocks.dart'; |
| 31 import 'reflective_tests.dart'; | 31 import 'reflective_tests.dart'; |
| 32 | 32 |
| 33 main() { | 33 main() { |
| 34 groupSep = ' | '; | 34 groupSep = ' | '; |
| 35 runReflectiveTests(CompletionManagerTest); | 35 runReflectiveTests(CompletionManagerTest); |
| 36 runReflectiveTests(CompletionTest); | 36 runReflectiveTests(CompletionTest); |
| 37 } | 37 } |
| 38 | 38 |
| 39 @ReflectiveTestCase() | 39 @reflectiveTest |
| 40 class CompletionManagerTest extends AbstractAnalysisTest { | 40 class CompletionManagerTest extends AbstractAnalysisTest { |
| 41 AnalysisDomainHandler analysisDomain; | 41 AnalysisDomainHandler analysisDomain; |
| 42 Test_CompletionDomainHandler completionDomain; | 42 Test_CompletionDomainHandler completionDomain; |
| 43 Request request; | 43 Request request; |
| 44 int requestCount = 0; | 44 int requestCount = 0; |
| 45 String testFile2 = '/project/bin/test2.dart'; | 45 String testFile2 = '/project/bin/test2.dart'; |
| 46 | 46 |
| 47 AnalysisServer createAnalysisServer(Index index) { | 47 AnalysisServer createAnalysisServer(Index index) { |
| 48 return new Test_AnalysisServer( | 48 return new Test_AnalysisServer( |
| 49 super.serverChannel, | 49 super.serverChannel, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return pumpEventQueue().then((_) { | 235 return pumpEventQueue().then((_) { |
| 236 expect(completionDomain.manager, isNotNull); | 236 expect(completionDomain.manager, isNotNull); |
| 237 ChangeSet changeSet = new ChangeSet(); | 237 ChangeSet changeSet = new ChangeSet(); |
| 238 changeSet.removedSource(completionDomain.manager.source); | 238 changeSet.removedSource(completionDomain.manager.source); |
| 239 completionDomain.sourcesChanged(new SourcesChangedEvent(changeSet)); | 239 completionDomain.sourcesChanged(new SourcesChangedEvent(changeSet)); |
| 240 expect(completionDomain.manager, isNull); | 240 expect(completionDomain.manager, isNull); |
| 241 }); | 241 }); |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 @ReflectiveTestCase() | 245 @reflectiveTest |
| 246 class CompletionTest extends AbstractAnalysisTest { | 246 class CompletionTest extends AbstractAnalysisTest { |
| 247 String completionId; | 247 String completionId; |
| 248 int completionOffset; | 248 int completionOffset; |
| 249 int replacementOffset; | 249 int replacementOffset; |
| 250 int replacementLength; | 250 int replacementLength; |
| 251 List<CompletionSuggestion> suggestions = []; | 251 List<CompletionSuggestion> suggestions = []; |
| 252 bool suggestionsDone = false; | 252 bool suggestionsDone = false; |
| 253 | 253 |
| 254 String addTestFile(String content) { | 254 String addTestFile(String content) { |
| 255 completionOffset = content.indexOf('^'); | 255 completionOffset = content.indexOf('^'); |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 626 |
| 627 void contextsChangedRaw(ContextsChangedEvent newEvent) { | 627 void contextsChangedRaw(ContextsChangedEvent newEvent) { |
| 628 super.contextsChanged(newEvent); | 628 super.contextsChanged(newEvent); |
| 629 } | 629 } |
| 630 | 630 |
| 631 CompletionManager createCompletionManager(AnalysisContext context, | 631 CompletionManager createCompletionManager(AnalysisContext context, |
| 632 Source source, SearchEngine searchEngine) { | 632 Source source, SearchEngine searchEngine) { |
| 633 return new MockCompletionManager(mockContext, source, searchEngine); | 633 return new MockCompletionManager(mockContext, source, searchEngine); |
| 634 } | 634 } |
| 635 } | 635 } |
| OLD | NEW |