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

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_test_util.dart

Issue 551103003: Fix for List<Future> is not assignable to List. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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.services.completion.util; 5 library test.services.completion.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
10 import 'package:analysis_server/src/services/index/index.dart'; 11 import 'package:analysis_server/src/services/index/index.dart';
11 import 'package:analysis_server/src/services/index/local_memory_index.dart'; 12 import 'package:analysis_server/src/services/index/local_memory_index.dart';
12 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
13 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ; 13 import 'package:analysis_server/src/services/search/search_engine_internal.dart' ;
14 import '../../abstract_context.dart';
15 import '../../mock_sdk.dart';
16 import 'package:analyzer/src/generated/ast.dart'; 14 import 'package:analyzer/src/generated/ast.dart';
17 import 'package:analyzer/src/generated/element.dart'; 15 import 'package:analyzer/src/generated/element.dart';
18 import 'package:analyzer/src/generated/engine.dart'; 16 import 'package:analyzer/src/generated/engine.dart';
19 import 'package:analyzer/src/generated/source.dart'; 17 import 'package:analyzer/src/generated/source.dart';
20 import 'package:unittest/unittest.dart'; 18 import 'package:unittest/unittest.dart';
21 19
20 import '../../abstract_context.dart';
21
22 class AbstractCompletionTest extends AbstractContextTest { 22 class AbstractCompletionTest extends AbstractContextTest {
23 Index index; 23 Index index;
24 SearchEngineImpl searchEngine; 24 SearchEngineImpl searchEngine;
25 DartCompletionComputer computer; 25 DartCompletionComputer computer;
26 String testFile = '/completionTest.dart'; 26 String testFile = '/completionTest.dart';
27 Source testSource; 27 Source testSource;
28 int completionOffset; 28 int completionOffset;
29 bool _computeFastCalled = false; 29 bool _computeFastCalled = false;
30 DartCompletionRequest request; 30 DartCompletionRequest request;
31 31
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 CompilationUnit unit = context.parseCompilationUnit(testSource); 155 CompilationUnit unit = context.parseCompilationUnit(testSource);
156 request.unit = unit; 156 request.unit = unit;
157 request.node = new NodeLocator.con1(completionOffset).searchWithin(unit); 157 request.node = new NodeLocator.con1(completionOffset).searchWithin(unit);
158 return computer.computeFast(request); 158 return computer.computeFast(request);
159 } 159 }
160 160
161 Future<bool> computeFull([bool fullAnalysis = false]) { 161 Future<bool> computeFull([bool fullAnalysis = false]) {
162 if (!_computeFastCalled) { 162 if (!_computeFastCalled) {
163 expect(computeFast(), isFalse); 163 expect(computeFast(), isFalse);
164 } 164 }
165
166 // Index SDK
167 for (Source librarySource in context.librarySources) {
168 CompilationUnit unit = context.getResolvedCompilationUnit2(librarySource, librarySource);
169 if (unit != null) {
170 index.indexUnit(context, unit);
171 }
172 }
173
165 var result = context.performAnalysisTask(); 174 var result = context.performAnalysisTask();
166 bool resolved = false; 175 bool resolved = false;
167 while (result.hasMoreWork) { 176 while (result.hasMoreWork) {
168 177
169 // Update the index 178 // Update the index
170 result.changeNotices.forEach((ChangeNotice notice) { 179 result.changeNotices.forEach((ChangeNotice notice) {
171 CompilationUnit unit = notice.compilationUnit; 180 CompilationUnit unit = notice.compilationUnit;
172 if (unit != null) { 181 if (unit != null) {
173 index.indexUnit(context, unit); 182 index.indexUnit(context, unit);
174 } 183 }
(...skipping 21 matching lines...) Expand all
196 fail('expected unit to be resolved'); 205 fail('expected unit to be resolved');
197 } 206 }
198 return computer.computeFull(request); 207 return computer.computeFull(request);
199 } 208 }
200 209
201 @override 210 @override
202 void setUp() { 211 void setUp() {
203 super.setUp(); 212 super.setUp();
204 index = createLocalMemoryIndex(); 213 index = createLocalMemoryIndex();
205 searchEngine = new SearchEngineImpl(index); 214 searchEngine = new SearchEngineImpl(index);
206 addResolvedUnit(MockSdk.LIB_CORE.path, MockSdk.LIB_CORE.content);
scheglov 2014/09/09 16:24:10 This line violates the Spec by declaring class Obj
207 } 215 }
208 } 216 }
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