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

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: Always compute canonical names. Use shared name root. 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 String get name { 185 String get name {
186 return fullCompile ? "${astKind} compile" : "outline"; 186 return fullCompile ? "${astKind} compile" : "outline";
187 } 187 }
188 188
189 bool get isCompiler => fullCompile; 189 bool get isCompiler => fullCompile;
190 190
191 Future<Result<Program>> run( 191 Future<Result<Program>> run(
192 TestDescription description, FastaContext context) async { 192 TestDescription description, FastaContext context) async {
193 Program platform = await context.loadPlatform(); 193 Program platform = await context.loadPlatform();
194 Ticker ticker = new Ticker(); 194 Ticker ticker = new Ticker();
195 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); 195 DillTarget dillTarget = new DillTarget(null, ticker, context.uriTranslator);
196 platform.unbindCanonicalNames();
196 dillTarget.loader.appendLibraries(platform); 197 dillTarget.loader.appendLibraries(platform);
197 KernelTarget sourceTarget = astKind == AstKind.Analyzer 198 KernelTarget sourceTarget = astKind == AstKind.Analyzer
198 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) 199 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode)
199 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, 200 : new KernelTarget(PhysicalFileSystem.instance, dillTarget,
200 context.uriTranslator, strongMode); 201 context.uriTranslator, strongMode);
201 202
202 Program p; 203 Program p;
203 try { 204 try {
204 sourceTarget.read(description.uri); 205 sourceTarget.read(description.uri);
205 await dillTarget.writeOutline(null); 206 await dillTarget.writeOutline(null);
(...skipping 14 matching lines...) Expand all
220 return fail(null, instrumentation.problemsAsString); 221 return fail(null, instrumentation.problemsAsString);
221 } 222 }
222 } 223 }
223 } 224 }
224 } on InputError catch (e, s) { 225 } on InputError catch (e, s) {
225 return fail(null, e.error, s); 226 return fail(null, e.error, s);
226 } 227 }
227 return pass(p); 228 return pass(p);
228 } 229 }
229 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698