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

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

Issue 2690063002: Refactor CompilerOutput (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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 | « tests/compiler/dart2js/output_type_test.dart ('k') | tests/compiler/dart2js/private_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:compiler/compiler_new.dart';
7 import 'memory_compiler.dart' show runCompiler, OutputCollector; 8 import 'memory_compiler.dart' show runCompiler, OutputCollector;
8 9
9 const MEMORY_SOURCE_FILES = const <String, String>{ 10 const MEMORY_SOURCE_FILES = const <String, String>{
10 'main.dart': """ 11 'main.dart': """
11 library main; 12 library main;
12 13
13 @MirrorsUsed(targets: const ['main', 'lib']) 14 @MirrorsUsed(targets: const ['main', 'lib'])
14 import 'dart:mirrors'; 15 import 'dart:mirrors';
15 import 'lib.dart'; 16 import 'lib.dart';
16 17
(...skipping 21 matching lines...) Expand all
38 }; 39 };
39 40
40 runTest(bool preserveUris) async { 41 runTest(bool preserveUris) async {
41 OutputCollector collector = new OutputCollector(); 42 OutputCollector collector = new OutputCollector();
42 var options = ["--minify"]; 43 var options = ["--minify"];
43 if (preserveUris) options.add("--preserve-uris"); 44 if (preserveUris) options.add("--preserve-uris");
44 await runCompiler( 45 await runCompiler(
45 memorySourceFiles: MEMORY_SOURCE_FILES, 46 memorySourceFiles: MEMORY_SOURCE_FILES,
46 outputProvider: collector, 47 outputProvider: collector,
47 options: options); 48 options: options);
48 String jsOutput = collector.getOutput('', 'js'); 49 String jsOutput = collector.getOutput('', OutputType.js);
49 Expect.equals(preserveUris, jsOutput.contains("main.dart")); 50 Expect.equals(preserveUris, jsOutput.contains("main.dart"));
50 Expect.equals(preserveUris, jsOutput.contains("lib.dart")); 51 Expect.equals(preserveUris, jsOutput.contains("lib.dart"));
51 } 52 }
52 53
53 void main() { 54 void main() {
54 asyncTest(() async { 55 asyncTest(() async {
55 await runTest(true); 56 await runTest(true);
56 await runTest(false); 57 await runTest(false);
57 }); 58 });
58 } 59 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/output_type_test.dart ('k') | tests/compiler/dart2js/private_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698