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

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

Issue 2569733002: Even less reliance on Compiler.closedWorld (Closed)
Patch Set: Updated cf. comments. Created 4 years 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 | « pkg/compiler/lib/src/world.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) 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 // Test that parameters keep their names in the output. 4 // Test that parameters keep their names in the output.
5 5
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'memory_compiler.dart'; 9 import 'memory_compiler.dart';
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 typedef void JsonTaking(Map<String, dynamic> json); 97 typedef void JsonTaking(Map<String, dynamic> json);
98 98
99 jsonTest(String program, JsonTaking testFn) async { 99 jsonTest(String program, JsonTaking testFn) async {
100 var result = await runCompiler( 100 var result = await runCompiler(
101 memorySourceFiles: {'main.dart': program}, options: ['--dump-info']); 101 memorySourceFiles: {'main.dart': program}, options: ['--dump-info']);
102 var compiler = result.compiler; 102 var compiler = result.compiler;
103 Expect.isFalse(compiler.compilationFailed); 103 Expect.isFalse(compiler.compilationFailed);
104 var dumpTask = compiler.dumpInfoTask; 104 var dumpTask = compiler.dumpInfoTask;
105 105
106 StringBuffer sb = new StringBuffer(); 106 StringBuffer sb = new StringBuffer();
107 dumpTask.dumpInfoJson(sb); 107 dumpTask.dumpInfoJson(sb, compiler.closedWorld);
108 String json = sb.toString(); 108 String json = sb.toString();
109 Map<String, dynamic> map = JSON.decode(json); 109 Map<String, dynamic> map = JSON.decode(json);
110 110
111 testFn(map); 111 testFn(map);
112 } 112 }
113 113
114 main() { 114 main() {
115 asyncTest(runTests); 115 asyncTest(runTests);
116 } 116 }
117 117
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 Expect.isTrue(main_ != null); 172 Expect.isTrue(main_ != null);
173 Expect.isTrue(fn1 != null); 173 Expect.isTrue(fn1 != null);
174 Expect.isTrue(fn2 != null); 174 Expect.isTrue(fn2 != null);
175 Expect.isTrue(deps.containsKey(main_['id'])); 175 Expect.isTrue(deps.containsKey(main_['id']));
176 Expect.isTrue(deps.containsKey(fn1['id'])); 176 Expect.isTrue(deps.containsKey(fn1['id']));
177 Expect.isTrue(deps.containsKey(fn2['id'])); 177 Expect.isTrue(deps.containsKey(fn2['id']));
178 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id'])); 178 Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id']));
179 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id'])); 179 Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id']));
180 }); 180 });
181 } 181 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698