OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
7 library analyzer.test.src.task.strong.strong_test_helper; | 7 library analyzer.test.src.task.strong.strong_test_helper; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 StringBuffer logBuffer = new StringBuffer(); | 301 StringBuffer logBuffer = new StringBuffer(); |
302 FileContentOverlay fileContentOverlay = new FileContentOverlay(); | 302 FileContentOverlay fileContentOverlay = new FileContentOverlay(); |
303 PerformanceLog log = new PerformanceLog(logBuffer); | 303 PerformanceLog log = new PerformanceLog(logBuffer); |
304 AnalysisDriverScheduler scheduler = new AnalysisDriverScheduler(log); | 304 AnalysisDriverScheduler scheduler = new AnalysisDriverScheduler(log); |
305 _driver = new AnalysisDriver( | 305 _driver = new AnalysisDriver( |
306 scheduler, | 306 scheduler, |
307 log, | 307 log, |
308 _resourceProvider, | 308 _resourceProvider, |
309 new MemoryByteStore(), | 309 new MemoryByteStore(), |
310 fileContentOverlay, | 310 fileContentOverlay, |
311 'test', | 311 null, |
312 sourceFactory, | 312 sourceFactory, |
313 analysisOptions); | 313 analysisOptions); |
314 scheduler.start(); | 314 scheduler.start(); |
315 | 315 |
316 mainUnit = (await _driver.getResult(mainFile.path)).unit; | 316 mainUnit = (await _driver.getResult(mainFile.path)).unit; |
317 } else { | 317 } else { |
318 _context = AnalysisEngine.instance.createAnalysisContext(); | 318 _context = AnalysisEngine.instance.createAnalysisContext(); |
319 _context.analysisOptions = analysisOptions; | 319 _context.analysisOptions = analysisOptions; |
320 _context.sourceFactory = sourceFactory; | 320 _context.sourceFactory = sourceFactory; |
321 | 321 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 @override | 473 @override |
474 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 474 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
475 if (uri.scheme == 'package') { | 475 if (uri.scheme == 'package') { |
476 return (provider.getResource( | 476 return (provider.getResource( |
477 provider.convertPath('/packages/' + uri.path)) as File) | 477 provider.convertPath('/packages/' + uri.path)) as File) |
478 .createSource(uri); | 478 .createSource(uri); |
479 } | 479 } |
480 return super.resolveAbsolute(uri, actualUri); | 480 return super.resolveAbsolute(uri, actualUri); |
481 } | 481 } |
482 } | 482 } |
OLD | NEW |