| 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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 class MockContext implements AnalysisContext { | 540 class MockContext implements AnalysisContext { |
| 541 MockStream<SourcesChangedEvent> mockStream; | 541 MockStream<SourcesChangedEvent> mockStream; |
| 542 | 542 |
| 543 MockContext() { | 543 MockContext() { |
| 544 mockStream = new MockStream<SourcesChangedEvent>(); | 544 mockStream = new MockStream<SourcesChangedEvent>(); |
| 545 } | 545 } |
| 546 | 546 |
| 547 @override | 547 @override |
| 548 Stream<SourcesChangedEvent> get onSourcesChanged => mockStream; | 548 Stream<SourcesChangedEvent> get onSourcesChanged => mockStream; |
| 549 | 549 |
| 550 @override |
| 551 TimestampedData<String> getContents(Source source) { |
| 552 return source.contents; |
| 553 } |
| 554 |
| 550 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); | 555 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); |
| 551 } | 556 } |
| 552 | 557 |
| 553 /** | 558 /** |
| 554 * Mock stream for tracking calls to listen and subscription.cancel. | 559 * Mock stream for tracking calls to listen and subscription.cancel. |
| 555 */ | 560 */ |
| 556 class MockStream<E> implements Stream<E> { | 561 class MockStream<E> implements Stream<E> { |
| 557 MockSubscription<E> mockSubscription = new MockSubscription<E>(); | 562 MockSubscription<E> mockSubscription = new MockSubscription<E>(); |
| 558 int listenCount = 0; | 563 int listenCount = 0; |
| 559 | 564 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 631 |
| 627 void contextsChangedRaw(ContextsChangedEvent newEvent) { | 632 void contextsChangedRaw(ContextsChangedEvent newEvent) { |
| 628 super.contextsChanged(newEvent); | 633 super.contextsChanged(newEvent); |
| 629 } | 634 } |
| 630 | 635 |
| 631 CompletionManager createCompletionManager(AnalysisContext context, | 636 CompletionManager createCompletionManager(AnalysisContext context, |
| 632 Source source, SearchEngine searchEngine) { | 637 Source source, SearchEngine searchEngine) { |
| 633 return new MockCompletionManager(mockContext, source, searchEngine); | 638 return new MockCompletionManager(mockContext, source, searchEngine); |
| 634 } | 639 } |
| 635 } | 640 } |
| OLD | NEW |