| 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 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 await compilerDeserialized.run(entryPoint); | 91 await compilerDeserialized.run(entryPoint); |
| 92 compilerDeserialized.closeResolution(); | 92 compilerDeserialized.closeResolution(); |
| 93 return compilerDeserialized; | 93 return compilerDeserialized; |
| 94 }); | 94 }); |
| 95 | 95 |
| 96 return measure(title, 'check models', () async { | 96 return measure(title, 'check models', () async { |
| 97 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); | 97 checkAllImpacts(compilerNormal, compilerDeserialized, verbose: verbose); |
| 98 checkResolutionEnqueuers(compilerNormal.enqueuer.resolution, | 98 checkResolutionEnqueuers(compilerNormal.enqueuer.resolution, |
| 99 compilerDeserialized.enqueuer.resolution, | 99 compilerDeserialized.enqueuer.resolution, |
| 100 verbose: verbose); | 100 verbose: verbose); |
| 101 checkClosedWorlds( | 101 checkClosedWorlds(compilerNormal.resolverWorld.closedWorldForTesting, |
| 102 compilerNormal.closedWorld, compilerDeserialized.closedWorld, | 102 compilerDeserialized.resolverWorld.closedWorldForTesting, |
| 103 verbose: verbose); | 103 verbose: verbose); |
| 104 checkBackendInfo(compilerNormal, compilerDeserialized, verbose: verbose); | 104 checkBackendInfo(compilerNormal, compilerDeserialized, verbose: verbose); |
| 105 }); | 105 }); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void checkResolutionEnqueuers( | 108 void checkResolutionEnqueuers( |
| 109 ResolutionEnqueuer enqueuer1, ResolutionEnqueuer enqueuer2, | 109 ResolutionEnqueuer enqueuer1, ResolutionEnqueuer enqueuer2, |
| 110 {bool typeEquivalence(DartType a, DartType b): areTypesEquivalent, | 110 {bool typeEquivalence(DartType a, DartType b): areTypesEquivalent, |
| 111 bool elementFilter(Element element), | 111 bool elementFilter(Element element), |
| 112 bool verbose: false}) { | 112 bool verbose: false}) { |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 a, b, (a, b) => areInstancesEquivalent(a, b, typeEquivalence))); | 434 a, b, (a, b) => areInstancesEquivalent(a, b, typeEquivalence))); |
| 435 return true; | 435 return true; |
| 436 } | 436 } |
| 437 | 437 |
| 438 bool areInstancesEquivalent(Instance instance1, Instance instance2, | 438 bool areInstancesEquivalent(Instance instance1, Instance instance2, |
| 439 bool typeEquivalence(DartType a, DartType b)) { | 439 bool typeEquivalence(DartType a, DartType b)) { |
| 440 return typeEquivalence(instance1.type, instance2.type) && | 440 return typeEquivalence(instance1.type, instance2.type) && |
| 441 instance1.kind == instance2.kind && | 441 instance1.kind == instance2.kind && |
| 442 instance1.isRedirection == instance2.isRedirection; | 442 instance1.isRedirection == instance2.isRedirection; |
| 443 } | 443 } |
| OLD | NEW |