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

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

Issue 1891193003: Fix serialization of forwarding constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 years, 8 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_impact_test; 5 library dart2js.serialization_impact_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:compiler/src/commandline_options.dart'; 9 import 'package:compiler/src/commandline_options.dart';
10 import 'package:compiler/src/common/resolution.dart'; 10 import 'package:compiler/src/common/resolution.dart';
11 import 'package:compiler/src/compiler.dart'; 11 import 'package:compiler/src/compiler.dart';
12 import 'package:compiler/src/elements/elements.dart'; 12 import 'package:compiler/src/elements/elements.dart';
13 import 'package:compiler/src/filenames.dart'; 13 import 'package:compiler/src/filenames.dart';
14 import 'package:compiler/src/serialization/equivalence.dart'; 14 import 'package:compiler/src/serialization/equivalence.dart';
15 import 'memory_compiler.dart'; 15 import 'memory_compiler.dart';
16 import 'serialization_helper.dart'; 16 import 'serialization_helper.dart';
17 import 'serialization_test_helper.dart'; 17 import 'serialization_test_helper.dart';
18 18
19 main(List<String> arguments) { 19 main(List<String> args) {
20 Arguments arguments = new Arguments.from(args);
20 asyncTest(() async { 21 asyncTest(() async {
21 String serializedData = await serializeDartCore(); 22 String serializedData = await serializeDartCore(arguments: arguments);
22 if (arguments.isNotEmpty) { 23 if (arguments.filename != null) {
23 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last)); 24 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
24 await check(serializedData, entryPoint); 25 await check(serializedData, entryPoint);
25 } else { 26 } else {
26 Uri entryPoint = Uri.parse('memory:main.dart'); 27 Uri entryPoint = Uri.parse('memory:main.dart');
27 await check(serializedData, entryPoint, {'main.dart': 'main() {}'}); 28 await check(serializedData, entryPoint,
29 sourceFiles: {'main.dart': 'main() {}'},
30 verbose: arguments.verbose);
28 } 31 }
29 }); 32 });
30 } 33 }
31 34
32 Future check( 35 Future check(
33 String serializedData, 36 String serializedData,
34 Uri entryPoint, 37 Uri entryPoint,
35 [Map<String, String> sourceFiles = const <String, String>{}]) async { 38 {Map<String, String> sourceFiles: const <String, String>{},
39 bool verbose: false}) async {
36 40
37 Compiler compilerNormal = compilerFor( 41 Compiler compilerNormal = compilerFor(
38 memorySourceFiles: sourceFiles, 42 memorySourceFiles: sourceFiles,
39 options: [Flags.analyzeOnly]); 43 options: [Flags.analyzeAll]);
40 compilerNormal.resolution.retainCachesForTesting = true; 44 compilerNormal.resolution.retainCachesForTesting = true;
41 await compilerNormal.run(entryPoint); 45 await compilerNormal.run(entryPoint);
42 46
43 Compiler compilerDeserialized = compilerFor( 47 Compiler compilerDeserialized = compilerFor(
44 memorySourceFiles: sourceFiles, 48 memorySourceFiles: sourceFiles,
45 options: [Flags.analyzeOnly]); 49 options: [Flags.analyzeAll]);
46 compilerDeserialized.resolution.retainCachesForTesting = true; 50 compilerDeserialized.resolution.retainCachesForTesting = true;
47 deserialize(compilerDeserialized, serializedData); 51 deserialize(compilerDeserialized, serializedData);
48 await compilerDeserialized.run(entryPoint); 52 await compilerDeserialized.run(entryPoint);
49 53
50 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: true); 54 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose);
51 } 55 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization_helper.dart ('k') | tests/compiler/dart2js/serialization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698