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

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

Issue 824103005: Revert "Remove Compiler.assembledCode." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.test.uri_retention_test; 5 library dart2js.test.uri_retention_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import "package:async_helper/async_helper.dart"; 10 import "package:async_helper/async_helper.dart";
11 11
12 import 'memory_compiler.dart' show 12 import 'memory_compiler.dart' show
13 compilerFor, OutputCollector; 13 compilerFor;
14 14
15 Future<String> compileSources(sources, {bool minify, bool preserveUri}) { 15 Future<String> compileSources(sources, {bool minify, bool preserveUri}) {
16 var options = []; 16 var options = [];
17 if (minify) options.add("--minify"); 17 if (minify) options.add("--minify");
18 if (preserveUri) options.add("--preserve-uris"); 18 if (preserveUri) options.add("--preserve-uris");
19 OutputCollector outputCollector = new OutputCollector(); 19 var compiler = compilerFor(sources, options: options);
20 var compiler = compilerFor(
21 sources, options: options, outputProvider: outputCollector);
22 return compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) { 20 return compiler.runCompiler(Uri.parse('memory:main.dart')).then((_) {
23 return outputCollector.getOutput('', 'js'); 21 return compiler.assembledCode;
24 }); 22 });
25 } 23 }
26 24
27 Future test(sources, { bool libName, bool fileName }) { 25 Future test(sources, { bool libName, bool fileName }) {
28 return 26 return
29 compileSources(sources, minify: false, preserveUri: false).then((output) { 27 compileSources(sources, minify: false, preserveUri: false).then((output) {
30 // Unminified the sources should always contain the library name and the 28 // Unminified the sources should always contain the library name and the
31 // file name. 29 // file name.
32 Expect.isTrue(output.contains("main_lib")); 30 Expect.isTrue(output.contains("main_lib"));
33 Expect.isTrue(output.contains("main.dart")); 31 Expect.isTrue(output.contains("main.dart"));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 library main_lib; 102 library main_lib;
105 103
106 @MirrorsUsed(targets: 'main_lib') 104 @MirrorsUsed(targets: 'main_lib')
107 import 'dart:mirrors'; 105 import 'dart:mirrors';
108 106
109 main() { 107 main() {
110 print(currentMirrorSystem().findLibrary(#main_lib).uri); 108 print(currentMirrorSystem().findLibrary(#main_lib).uri);
111 } 109 }
112 """, 110 """,
113 }; 111 };
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/source_map_deferred_d2js_validity_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698