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

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

Issue 2616493004: Fix part related completion tests with the new analysis driver. (Closed)
Patch Set: Created 3 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
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.dart.util; 5 library test.services.completion.dart.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 assertHasNoParameterInfo(cs); 430 assertHasNoParameterInfo(cs);
431 return cs; 431 return cs;
432 } 432 }
433 433
434 /** 434 /**
435 * Return a [Future] that completes with the containing library information 435 * Return a [Future] that completes with the containing library information
436 * after it is accessible via [context.getLibrariesContaining]. 436 * after it is accessible via [context.getLibrariesContaining].
437 */ 437 */
438 Future<Null> computeLibrariesContaining([int times = 200]) { 438 Future<Null> computeLibrariesContaining([int times = 200]) {
439 if (enableNewAnalysisDriver) { 439 if (enableNewAnalysisDriver) {
440 return new Future.value(null); 440 return driver.getResult(testFile).then((result) => null);
441 } 441 }
442 List<Source> libraries = context.getLibrariesContaining(testSource); 442 List<Source> libraries = context.getLibrariesContaining(testSource);
443 if (libraries.isNotEmpty) { 443 if (libraries.isNotEmpty) {
444 return new Future.value(null); 444 return new Future.value(null);
445 } 445 }
446 if (times == 0) { 446 if (times == 0) {
447 fail('failed to determine libraries containing $testSource'); 447 fail('failed to determine libraries containing $testSource');
448 } 448 }
449 context.performAnalysisTask(); 449 context.performAnalysisTask();
450 // We use a delayed future to allow microtask events to finish. The 450 // We use a delayed future to allow microtask events to finish. The
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 } 576 }
577 577
578 @override 578 @override
579 void setUp() { 579 void setUp() {
580 super.setUp(); 580 super.setUp();
581 index = createMemoryIndex(); 581 index = createMemoryIndex();
582 searchEngine = new SearchEngineImpl(index); 582 searchEngine = new SearchEngineImpl(index);
583 contributor = createContributor(); 583 contributor = createContributor();
584 } 584 }
585 } 585 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698