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

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

Issue 1314973003: Add support for analyzing individual URIs. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.serialization_analysis_test; 5 library dart2js.serialization_analysis_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/elements/elements.dart'; 10 import 'package:compiler/src/elements/elements.dart';
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 diagnosticCollector.warnings.length, 194 diagnosticCollector.warnings.length,
195 "Unexpected warning count."); 195 "Unexpected warning count.");
196 Expect.equals(test.expectedHintCount, diagnosticCollector.hints.length, 196 Expect.equals(test.expectedHintCount, diagnosticCollector.hints.length,
197 "Unexpected hint count."); 197 "Unexpected hint count.");
198 Expect.equals(test.expectedInfoCount, diagnosticCollector.infos.length, 198 Expect.equals(test.expectedInfoCount, diagnosticCollector.infos.length,
199 "Unexpected info count."); 199 "Unexpected info count.");
200 } 200 }
201 } 201 }
202 202
203 Future<String> serializeDartCore() async { 203 Future<String> serializeDartCore() async {
204 Compiler compiler = compilerFor({}, 204 Compiler compiler = compilerFor(
205 options: ['--analyze-all', '--output-type=dart']); 205 options: ['--analyze-all', '--output-type=dart']);
206 await compiler.runCompiler(Uri.parse('dart:core')); 206 await compiler.runCompiler(Uri.parse('dart:core'));
207 return serialize(compiler.libraryLoader.libraries); 207 return serialize(compiler.libraryLoader.libraries);
208 } 208 }
209 209
210 String serialize(Iterable<LibraryElement> libraries) { 210 String serialize(Iterable<LibraryElement> libraries) {
211 Serializer serializer = new Serializer(const JsonSerializationEncoder()); 211 Serializer serializer = new Serializer(const JsonSerializationEncoder());
212 for (LibraryElement library in libraries) { 212 for (LibraryElement library in libraries) {
213 serializer.serialize(library); 213 serializer.serialize(library);
214 } 214 }
(...skipping 17 matching lines...) Expand all
232 @override 232 @override
233 WorldImpact computeWorldImpact(Element element) { 233 WorldImpact computeWorldImpact(Element element) {
234 return const WorldImpact(); 234 return const WorldImpact();
235 } 235 }
236 236
237 @override 237 @override
238 bool isDeserialized(Element element) { 238 bool isDeserialized(Element element) {
239 return deserializedLibraries.contains(element.library); 239 return deserializedLibraries.contains(element.library);
240 } 240 }
241 } 241 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/message_kind_helper.dart ('k') | tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698