OLD | NEW |
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_model_test; | 5 library dart2js.serialization_model_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/closure.dart'; | 10 import 'package:compiler/src/closure.dart'; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 memorySourceFiles: serializedData.toMemorySourceFiles(), | 43 memorySourceFiles: serializedData.toMemorySourceFiles(), |
44 resolutionInputs: serializedData.toUris(), | 44 resolutionInputs: serializedData.toUris(), |
45 dataUri: Uri.parse('memory:test.data')); | 45 dataUri: Uri.parse('memory:test.data')); |
46 }); | 46 }); |
47 await checkModels(entryPoint, | 47 await checkModels(entryPoint, |
48 sourceFiles: serializedData | 48 sourceFiles: serializedData |
49 .toMemorySourceFiles(result.serializedData.toMemorySourceFiles()), | 49 .toMemorySourceFiles(result.serializedData.toMemorySourceFiles()), |
50 resolutionInputs: | 50 resolutionInputs: |
51 serializedData.toUris(result.serializedData.toUris())); | 51 serializedData.toUris(result.serializedData.toUris())); |
52 } else { | 52 } else { |
53 Uri entryPoint = Uri.parse('memory:main.dart'); | |
54 await arguments.forEachTest(serializedData, TESTS, checkModels); | 53 await arguments.forEachTest(serializedData, TESTS, checkModels); |
55 } | 54 } |
56 printMeasurementResults(); | 55 printMeasurementResults(); |
57 }); | 56 }); |
58 } | 57 } |
59 | 58 |
60 Future checkModels(Uri entryPoint, | 59 Future checkModels(Uri entryPoint, |
61 {Map<String, String> sourceFiles: const <String, String>{}, | 60 {Map<String, String> sourceFiles: const <String, String>{}, |
62 List<Uri> resolutionInputs, | 61 List<Uri> resolutionInputs, |
63 int index, | 62 int index, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', | 285 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', |
287 outputUnit1.isMainOutput, outputUnit2.isMainOutput); | 286 outputUnit1.isMainOutput, outputUnit2.isMainOutput); |
288 checkSetEquivalence( | 287 checkSetEquivalence( |
289 outputUnit1, | 288 outputUnit1, |
290 outputUnit2, | 289 outputUnit2, |
291 'OutputUnit.imports $message', | 290 'OutputUnit.imports $message', |
292 outputUnit1.imports, | 291 outputUnit1.imports, |
293 outputUnit2.imports, | 292 outputUnit2.imports, |
294 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); | 293 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); |
295 } | 294 } |
OLD | NEW |