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

Side by Side Diff: pkg/front_end/test/fasta/testing/suite.dart

Issue 2874723002: Add a way to use shared CanonicalName root to deserialize Program. (Closed)
Patch Set: Add TODO for 'uriToSource'. Created 3 years, 7 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library fasta.testing.suite; 5 library fasta.testing.suite;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:io' show File; 9 import 'dart:io' show File;
10 10
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return fullCompile ? "${astKind} compile" : "outline"; 199 return fullCompile ? "${astKind} compile" : "outline";
200 } 200 }
201 201
202 bool get isCompiler => fullCompile; 202 bool get isCompiler => fullCompile;
203 203
204 Future<Result<Program>> run( 204 Future<Result<Program>> run(
205 TestDescription description, FastaContext context) async { 205 TestDescription description, FastaContext context) async {
206 Program platformOutline = await context.loadPlatformOutline(); 206 Program platformOutline = await context.loadPlatformOutline();
207 Ticker ticker = new Ticker(); 207 Ticker ticker = new Ticker();
208 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); 208 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator);
209 platformOutline.unbindCanonicalNames();
209 dillTarget.loader.appendLibraries(platformOutline); 210 dillTarget.loader.appendLibraries(platformOutline);
210 KernelTarget sourceTarget = astKind == AstKind.Analyzer 211 KernelTarget sourceTarget = astKind == AstKind.Analyzer
211 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) 212 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode)
212 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, 213 : new KernelTarget(PhysicalFileSystem.instance, dillTarget,
213 context.uriTranslator, strongMode); 214 context.uriTranslator, strongMode);
214 215
215 Program p; 216 Program p;
216 try { 217 try {
217 sourceTarget.read(description.uri); 218 sourceTarget.read(description.uri);
218 await dillTarget.writeOutline(null); 219 await dillTarget.writeOutline(null);
(...skipping 14 matching lines...) Expand all
233 return fail(null, instrumentation.problemsAsString); 234 return fail(null, instrumentation.problemsAsString);
234 } 235 }
235 } 236 }
236 } 237 }
237 } on InputError catch (e, s) { 238 } on InputError catch (e, s) {
238 return fail(null, e.error, s); 239 return fail(null, e.error, s);
239 } 240 }
240 return pass(p); 241 return pass(p);
241 } 242 }
242 } 243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698