| OLD | NEW |
| 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 'helper.dart'; |
| 17 import 'serialization_test_helper.dart'; | 17 import 'test_helper.dart'; |
| 18 | 18 |
| 19 main(List<String> args) { | 19 main(List<String> args) { |
| 20 Arguments arguments = new Arguments.from(args); | 20 Arguments arguments = new Arguments.from(args); |
| 21 asyncTest(() async { | 21 asyncTest(() async { |
| 22 String serializedData = await serializeDartCore(arguments: arguments); | 22 String serializedData = await serializeDartCore(arguments: arguments); |
| 23 if (arguments.filename != null) { | 23 if (arguments.filename != null) { |
| 24 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); | 24 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); |
| 25 await check(serializedData, entryPoint); | 25 await check(serializedData, entryPoint); |
| 26 } else { | 26 } else { |
| 27 Uri entryPoint = Uri.parse('memory:main.dart'); | 27 Uri entryPoint = Uri.parse('memory:main.dart'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 46 | 46 |
| 47 Compiler compilerDeserialized = compilerFor( | 47 Compiler compilerDeserialized = compilerFor( |
| 48 memorySourceFiles: sourceFiles, | 48 memorySourceFiles: sourceFiles, |
| 49 options: [Flags.analyzeAll]); | 49 options: [Flags.analyzeAll]); |
| 50 compilerDeserialized.resolution.retainCachesForTesting = true; | 50 compilerDeserialized.resolution.retainCachesForTesting = true; |
| 51 deserialize(compilerDeserialized, serializedData); | 51 deserialize(compilerDeserialized, serializedData); |
| 52 await compilerDeserialized.run(entryPoint); | 52 await compilerDeserialized.run(entryPoint); |
| 53 | 53 |
| 54 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); | 54 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); |
| 55 } | 55 } |
| OLD | NEW |