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

Side by Side Diff: tests/compiler/dart2js/compiler_helper.dart

Issue 2167663002: Revert "Add fast-mode Uri class." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « sdk/lib/core/uri.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 compiler_helper; 5 library compiler_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 import 'package:compiler/src/elements/elements.dart' 10 import 'package:compiler/src/elements/elements.dart'
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 expectedErrors: expectedErrors, 172 expectedErrors: expectedErrors,
173 expectedWarnings: expectedWarnings); 173 expectedWarnings: expectedWarnings);
174 return compiler.run(uri).then((_) { 174 return compiler.run(uri).then((_) {
175 lego.Element element = findElement(compiler, name); 175 lego.Element element = findElement(compiler, name);
176 return check(compiler, element); 176 return check(compiler, element);
177 }); 177 });
178 } 178 }
179 179
180 Future compileSources(Map<String, String> sources, 180 Future compileSources(Map<String, String> sources,
181 check(MockCompiler compiler)) { 181 check(MockCompiler compiler)) {
182 Uri base = new Uri(scheme: 'source', path: '/'); 182 Uri base = new Uri(scheme: 'source');
183 Uri mainUri = base.resolve('main.dart'); 183 Uri mainUri = base.resolve('main.dart');
184 String mainCode = sources['main.dart']; 184 String mainCode = sources['main.dart'];
185 Expect.isNotNull(mainCode, 'No source code found for "main.dart"'); 185 Expect.isNotNull(mainCode, 'No source code found for "main.dart"');
186 MockCompiler compiler = compilerFor(mainCode, mainUri); 186 MockCompiler compiler = compilerFor(mainCode, mainUri);
187 sources.forEach((String path, String code) { 187 sources.forEach((String path, String code) {
188 if (path == 'main.dart') return; 188 if (path == 'main.dart') return;
189 compiler.registerSource(base.resolve(path), code); 189 compiler.registerSource(base.resolve(path), code);
190 }); 190 });
191 191
192 return compiler.run(mainUri).then((_) { 192 return compiler.run(mainUri).then((_) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); 290 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
291 final spaceRe = new RegExp('\\s+'); 291 final spaceRe = new RegExp('\\s+');
292 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); 292 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
293 if (shouldMatch) { 293 if (shouldMatch) {
294 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); 294 Expect.isTrue(new RegExp(regexp).hasMatch(generated));
295 } else { 295 } else {
296 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); 296 Expect.isFalse(new RegExp(regexp).hasMatch(generated));
297 } 297 }
298 }); 298 });
299 } 299 }
OLDNEW
« no previous file with comments | « sdk/lib/core/uri.dart ('k') | tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698