| 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'; |
| 11 import 'package:analysis_server/src/constants.dart'; | 11 import 'package:analysis_server/src/constants.dart'; |
| 12 import 'package:analysis_server/src/domain_analysis.dart'; | 12 import 'package:analysis_server/src/domain_analysis.dart'; |
| 13 import 'package:analysis_server/src/domain_completion.dart'; | 13 import 'package:analysis_server/src/domain_completion.dart'; |
| 14 import 'package:analysis_server/src/protocol.dart'; | 14 import 'package:analysis_server/src/protocol.dart'; |
| 15 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 15 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
| 16 import 'package:analysis_server/src/services/index/index.dart' show Index; | 16 import 'package:analysis_server/src/services/index/index.dart' show Index; |
| 17 import 'package:analysis_server/src/services/index/local_memory_index.dart'; | 17 import 'package:analysis_server/src/services/index/local_memory_index.dart'; |
| 18 import 'package:analysis_server/src/services/search/search_engine.dart'; | 18 import 'package:analysis_server/src/services/search/search_engine.dart'; |
| 19 import 'package:analyzer/file_system/file_system.dart'; | 19 import 'package:analyzer/file_system/file_system.dart'; |
| 20 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| 20 import 'package:analyzer/source/package_map_provider.dart'; | 21 import 'package:analyzer/source/package_map_provider.dart'; |
| 21 import 'package:analyzer/src/generated/engine.dart'; | 22 import 'package:analyzer/src/generated/engine.dart'; |
| 22 import 'package:analyzer/src/generated/sdk.dart'; | 23 import 'package:analyzer/src/generated/sdk.dart'; |
| 23 import 'package:analyzer/src/generated/source.dart'; | 24 import 'package:analyzer/src/generated/source.dart'; |
| 24 import 'package:unittest/unittest.dart'; | 25 import 'package:unittest/unittest.dart'; |
| 25 | 26 |
| 26 import 'analysis_abstract.dart'; | 27 import 'analysis_abstract.dart'; |
| 27 import 'mock_sdk.dart'; | 28 import 'mock_sdk.dart'; |
| 28 import 'mocks.dart'; | 29 import 'mocks.dart'; |
| 29 import 'reflective_tests.dart'; | 30 import 'reflective_tests.dart'; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 } | 511 } |
| 511 | 512 |
| 512 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 513 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 513 } | 514 } |
| 514 | 515 |
| 515 class Test_AnalysisServer extends AnalysisServer { | 516 class Test_AnalysisServer extends AnalysisServer { |
| 516 final MockContext mockContext = new MockContext(); | 517 final MockContext mockContext = new MockContext(); |
| 517 | 518 |
| 518 Test_AnalysisServer(ServerCommunicationChannel channel, | 519 Test_AnalysisServer(ServerCommunicationChannel channel, |
| 519 ResourceProvider resourceProvider, PackageMapProvider packageMapProvider, | 520 ResourceProvider resourceProvider, PackageMapProvider packageMapProvider, |
| 520 Index index, AnalysisServerOptions analysisServerOptions, DartSdk defaultS
dk) | 521 Index index, AnalysisServerOptions analysisServerOptions, DartSdk defaultS
dk, |
| 522 InstrumentationServer instrumentationServer) |
| 521 : super( | 523 : super( |
| 522 channel, | 524 channel, |
| 523 resourceProvider, | 525 resourceProvider, |
| 524 packageMapProvider, | 526 packageMapProvider, |
| 525 index, | 527 index, |
| 526 analysisServerOptions, | 528 analysisServerOptions, |
| 527 defaultSdk); | 529 defaultSdk, |
| 530 instrumentationServer); |
| 528 | 531 |
| 529 AnalysisContext getAnalysisContext(String path) { | 532 AnalysisContext getAnalysisContext(String path) { |
| 530 return mockContext; | 533 return mockContext; |
| 531 } | 534 } |
| 532 } | 535 } |
| 533 | 536 |
| 534 /** | 537 /** |
| 535 * A [CompletionDomainHandler] subclass that returns a mock completion manager | 538 * A [CompletionDomainHandler] subclass that returns a mock completion manager |
| 536 * so that the domain handler cache management can be tested. | 539 * so that the domain handler cache management can be tested. |
| 537 */ | 540 */ |
| (...skipping 15 matching lines...) Expand all Loading... |
| 553 | 556 |
| 554 void contextsChangedRaw(ContextsChangedEvent newEvent) { | 557 void contextsChangedRaw(ContextsChangedEvent newEvent) { |
| 555 super.contextsChanged(newEvent); | 558 super.contextsChanged(newEvent); |
| 556 } | 559 } |
| 557 | 560 |
| 558 CompletionManager createCompletionManager(AnalysisContext context, | 561 CompletionManager createCompletionManager(AnalysisContext context, |
| 559 Source source, SearchEngine searchEngine) { | 562 Source source, SearchEngine searchEngine) { |
| 560 return new MockCompletionManager(mockContext, source, searchEngine); | 563 return new MockCompletionManager(mockContext, source, searchEngine); |
| 561 } | 564 } |
| 562 } | 565 } |
| OLD | NEW |