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

Unified Diff: tests/compiler/dart2js/uri_retention_test.dart

Issue 582753002: dart2js: add --preserve-uris flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update tests. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/preserve_uris_test.dart ('k') | tests/lib/mirrors/libraries_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/uri_retention_test.dart
diff --git a/tests/compiler/dart2js/uri_retention_test.dart b/tests/compiler/dart2js/uri_retention_test.dart
index fcdcdcc0409a5554a2d77db20f3d4965bb95287a..d79aa320e3ecf5f47b043fb4c0a8271164fe458b 100644
--- a/tests/compiler/dart2js/uri_retention_test.dart
+++ b/tests/compiler/dart2js/uri_retention_test.dart
@@ -12,21 +12,30 @@ import "package:async_helper/async_helper.dart";
import 'memory_compiler.dart' show
compilerFor;
-Future<String> compileSources(sources, {bool minify}) {
- var compiler = compilerFor(sources, options: minify ? ['--minify'] : []);
+Future<String> compileSources(sources, {bool minify, bool preserveUri}) {
+ var options = [];
+ if (minify) options.add("--minify");
+ if (preserveUri) options.add("--preserve-uris");
+ var compiler = compilerFor(sources, options: options);
return compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
return compiler.assembledCode;
});
}
Future test(sources, { bool libName, bool fileName }) {
- return compileSources(sources, minify: false).then((output) {
+ return
+ compileSources(sources, minify: false, preserveUri: false).then((output) {
// Unminified the sources should always contain the library name and the
// file name.
Expect.isTrue(output.contains("main_lib"));
Expect.isTrue(output.contains("main.dart"));
}).then((_) {
- compileSources(sources, minify: true).then((output) {
+ compileSources(sources, minify: true, preserveUri: false).then((output) {
+ Expect.equals(libName, output.contains("main_lib"));
+ Expect.isFalse(output.contains("main.dart"));
+ });
+ }).then((_) {
+ compileSources(sources, minify: true, preserveUri: true).then((output) {
Expect.equals(libName, output.contains("main_lib"));
Expect.equals(fileName, output.contains("main.dart"));
});
« no previous file with comments | « tests/compiler/dart2js/preserve_uris_test.dart ('k') | tests/lib/mirrors/libraries_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698