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

Side by Side Diff: pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart

Issue 2614033003: Make subclasses of AbstractContextTest asynchronous. (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.refactoring; 5 library test.services.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart' 9 import 'package:analysis_server/plugin/protocol/protocol.dart'
10 show 10 show
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 153 }
154 154
155 /** 155 /**
156 * Completes with a fully resolved unit that contains the [element]. 156 * Completes with a fully resolved unit that contains the [element].
157 */ 157 */
158 Future<CompilationUnit> getResolvedUnitWithElement(Element element) async { 158 Future<CompilationUnit> getResolvedUnitWithElement(Element element) async {
159 return element.context 159 return element.context
160 .resolveCompilationUnit(element.source, element.library); 160 .resolveCompilationUnit(element.source, element.library);
161 } 161 }
162 162
163 void indexTestUnit(String code) { 163 Future<Null> indexTestUnit(String code) async {
164 resolveTestUnit(code); 164 await resolveTestUnit(code);
165 index.indexUnit(testUnit); 165 index.indexUnit(testUnit);
166 } 166 }
167 167
168 void indexUnit(String file, String code) { 168 Future<Null> indexUnit(String file, String code) async {
169 Source source = addSource(file, code); 169 Source source = addSource(file, code);
170 CompilationUnit unit = resolveLibraryUnit(source); 170 CompilationUnit unit = await resolveLibraryUnit(source);
171 index.indexUnit(unit); 171 index.indexUnit(unit);
172 } 172 }
173 173
174 void setUp() { 174 void setUp() {
175 super.setUp(); 175 super.setUp();
176 index = createMemoryIndex(); 176 index = createMemoryIndex();
177 searchEngine = new SearchEngineImpl(index); 177 searchEngine = new SearchEngineImpl(index);
178 } 178 }
179 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698