Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: pkg/analysis_server/test/domain_completion_test.dart

Issue 866973002: Fix 'MockContext does not implement getContents' test failures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698