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

Side by Side Diff: tests/compiler/dart2js/serialization/resolved_ast_test.dart

Issue 2013763002: Add names and support for preserialized data to serialization tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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_resolved_ast_test; 5 library dart2js.serialization_resolved_ast_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/compiler.dart'; 10 import 'package:compiler/src/compiler.dart';
(...skipping 11 matching lines...) Expand all
22 asyncTest(() async { 22 asyncTest(() async {
23 SerializedData serializedData = 23 SerializedData serializedData =
24 await serializeDartCore(arguments: arguments); 24 await serializeDartCore(arguments: arguments);
25 if (arguments.filename != null) { 25 if (arguments.filename != null) {
26 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); 26 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
27 await check(serializedData, entryPoint); 27 await check(serializedData, entryPoint);
28 } else { 28 } else {
29 Uri entryPoint = Uri.parse('memory:main.dart'); 29 Uri entryPoint = Uri.parse('memory:main.dart');
30 // TODO(johnniwinther): Change to test all serialized resolved ast instead 30 // TODO(johnniwinther): Change to test all serialized resolved ast instead
31 // only those used in the test. 31 // only those used in the test.
32 Test test = TESTS.last; 32 Test test = TESTS.first;
33 await check(serializedData, entryPoint, test.sourceFiles); 33 await check(serializedData, entryPoint, test.sourceFiles);
34 } 34 }
35 }); 35 });
36 } 36 }
37 37
38 Future check( 38 Future check(
39 SerializedData serializedData, 39 SerializedData serializedData,
40 Uri entryPoint, 40 Uri entryPoint,
41 [Map<String, String> sourceFiles = const <String, String>{}]) async { 41 [Map<String, String> sourceFiles = const <String, String>{}]) async {
42 42
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 if (resolvedAst1 == null || resolvedAst2 == null) return; 85 if (resolvedAst1 == null || resolvedAst2 == null) return;
86 86
87 if (verbose) { 87 if (verbose) {
88 print('Checking resolved asts for $member1 vs $member2'); 88 print('Checking resolved asts for $member1 vs $member2');
89 } 89 }
90 90
91 testResolvedAstEquivalence( 91 testResolvedAstEquivalence(
92 resolvedAst1, resolvedAst2, const CheckStrategy()); 92 resolvedAst1, resolvedAst2, const CheckStrategy());
93 } 93 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/serialization/model_test.dart ('k') | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698