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

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

Issue 2831903002: Correctly handle setters in KernelWorldBuilder (Closed)
Patch Set: Fix. Created 3 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
« no previous file with comments | « tests/compiler/dart2js/kernel/closed_world2_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 }, verbose: verbose); 127 }, verbose: verbose);
128 128
129 ResolutionWorldBuilderBase worldBuilder1 = enqueuer1.worldBuilder; 129 ResolutionWorldBuilderBase worldBuilder1 = enqueuer1.worldBuilder;
130 ResolutionWorldBuilderBase worldBuilder2 = enqueuer2.worldBuilder; 130 ResolutionWorldBuilderBase worldBuilder2 = enqueuer2.worldBuilder;
131 131
132 checkMaps( 132 checkMaps(
133 worldBuilder1.getInstantiationMap(), 133 worldBuilder1.getInstantiationMap(),
134 worldBuilder2.getInstantiationMap(), 134 worldBuilder2.getInstantiationMap(),
135 "Instantiated classes mismatch", 135 "Instantiated classes mismatch",
136 elementEquivalence, 136 elementEquivalence,
137 (a, b) => areInstantiationInfosEquivalent(a, b, typeEquivalence), 137 (a, b) => areInstantiationInfosEquivalent(
138 a, b, elementEquivalence, typeEquivalence),
138 verbose: verbose); 139 verbose: verbose);
139 140
140 checkSets( 141 checkSets(
141 enqueuer1.worldBuilder.directlyInstantiatedClasses, 142 enqueuer1.worldBuilder.directlyInstantiatedClasses,
142 enqueuer2.worldBuilder.directlyInstantiatedClasses, 143 enqueuer2.worldBuilder.directlyInstantiatedClasses,
143 "Directly instantiated classes mismatch", 144 "Directly instantiated classes mismatch",
144 elementEquivalence, 145 elementEquivalence,
145 verbose: verbose); 146 verbose: verbose);
146 147
147 checkSets( 148 checkSets(
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 outputUnit2, 437 outputUnit2,
437 'OutputUnit.imports $message', 438 'OutputUnit.imports $message',
438 outputUnit1.imports, 439 outputUnit1.imports,
439 outputUnit2.imports, 440 outputUnit2.imports,
440 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); 441 (a, b) => areElementsEquivalent(a.declaration, b.declaration));
441 } 442 }
442 443
443 bool areInstantiationInfosEquivalent( 444 bool areInstantiationInfosEquivalent(
444 InstantiationInfo info1, 445 InstantiationInfo info1,
445 InstantiationInfo info2, 446 InstantiationInfo info2,
446 bool typeEquivalence(ResolutionDartType a, ResolutionDartType b)) { 447 bool elementEquivalence(Entity a, Entity b),
448 bool typeEquivalence(DartType a, DartType b)) {
447 checkMaps( 449 checkMaps(
448 info1.instantiationMap, 450 info1.instantiationMap,
449 info2.instantiationMap, 451 info2.instantiationMap,
450 'instantiationMap of\n ' 452 'instantiationMap of\n '
451 '${info1.instantiationMap}\nvs ${info2.instantiationMap}', 453 '${info1.instantiationMap}\nvs ${info2.instantiationMap}',
452 areElementsEquivalent, 454 elementEquivalence,
453 (a, b) => areSetsEquivalent( 455 (a, b) => areSetsEquivalent(
454 a, b, (a, b) => areInstancesEquivalent(a, b, typeEquivalence))); 456 a, b, (a, b) => areInstancesEquivalent(a, b, typeEquivalence)));
455 return true; 457 return true;
456 } 458 }
457 459
458 bool areInstancesEquivalent(Instance instance1, Instance instance2, 460 bool areInstancesEquivalent(Instance instance1, Instance instance2,
459 bool typeEquivalence(ResolutionDartType a, ResolutionDartType b)) { 461 bool typeEquivalence(DartType a, DartType b)) {
460 ResolutionInterfaceType type1 = instance1.type; 462 InterfaceType type1 = instance1.type;
461 ResolutionInterfaceType type2 = instance2.type; 463 InterfaceType type2 = instance2.type;
462 return typeEquivalence(type1, type2) && 464 return typeEquivalence(type1, type2) &&
463 instance1.kind == instance2.kind && 465 instance1.kind == instance2.kind &&
464 instance1.isRedirection == instance2.isRedirection; 466 instance1.isRedirection == instance2.isRedirection;
465 } 467 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/closed_world2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698