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

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

Issue 2845093003: Handle mixed in members (Closed)
Patch Set: Created 3 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) 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void checkResolutionEnqueuers( 116 void checkResolutionEnqueuers(
117 BackendUsage backendUsage1, 117 BackendUsage backendUsage1,
118 BackendUsage backendUsage2, 118 BackendUsage backendUsage2,
119 ResolutionEnqueuer enqueuer1, 119 ResolutionEnqueuer enqueuer1,
120 ResolutionEnqueuer enqueuer2, 120 ResolutionEnqueuer enqueuer2,
121 {bool elementEquivalence(Entity a, Entity b): areElementsEquivalent, 121 {bool elementEquivalence(Entity a, Entity b): areElementsEquivalent,
122 bool typeEquivalence(DartType a, DartType b): areTypesEquivalent, 122 bool typeEquivalence(DartType a, DartType b): areTypesEquivalent,
123 bool elementFilter(Element element), 123 bool elementFilter(Element element),
124 bool verbose: false}) { 124 bool verbose: false}) {
125 checkSets(enqueuer1.processedEntities, enqueuer2.processedEntities,
126 "Processed element mismatch", elementEquivalence, elementFilter: (e) {
127 return elementFilter != null ? elementFilter(e) : true;
128 }, verbose: verbose);
129
130 ResolutionWorldBuilderBase worldBuilder1 = enqueuer1.worldBuilder; 125 ResolutionWorldBuilderBase worldBuilder1 = enqueuer1.worldBuilder;
131 ResolutionWorldBuilderBase worldBuilder2 = enqueuer2.worldBuilder; 126 ResolutionWorldBuilderBase worldBuilder2 = enqueuer2.worldBuilder;
132 127
133 checkMaps( 128 checkSets(
134 worldBuilder1.getInstantiationMap(), 129 enqueuer1.worldBuilder.instantiatedTypes,
135 worldBuilder2.getInstantiationMap(), 130 enqueuer2.worldBuilder.instantiatedTypes,
136 "Instantiated classes mismatch", 131 "Instantiated types mismatch",
137 elementEquivalence, 132 typeEquivalence,
138 (a, b) => areInstantiationInfosEquivalent(
139 a, b, elementEquivalence, typeEquivalence),
140 verbose: verbose); 133 verbose: verbose);
141 134
142 checkSets( 135 checkSets(
143 enqueuer1.worldBuilder.directlyInstantiatedClasses, 136 enqueuer1.worldBuilder.directlyInstantiatedClasses,
144 enqueuer2.worldBuilder.directlyInstantiatedClasses, 137 enqueuer2.worldBuilder.directlyInstantiatedClasses,
145 "Directly instantiated classes mismatch", 138 "Directly instantiated classes mismatch",
146 elementEquivalence, 139 elementEquivalence,
147 verbose: verbose); 140 verbose: verbose);
148 141
149 checkSets( 142 checkMaps(
150 enqueuer1.worldBuilder.instantiatedTypes, 143 worldBuilder1.getInstantiationMap(),
151 enqueuer2.worldBuilder.instantiatedTypes, 144 worldBuilder2.getInstantiationMap(),
152 "Instantiated types mismatch", 145 "Instantiated classes mismatch",
153 typeEquivalence, 146 elementEquivalence,
147 (a, b) => areInstantiationInfosEquivalent(
148 a, b, elementEquivalence, typeEquivalence),
154 verbose: verbose); 149 verbose: verbose);
155 150
151 checkSets(enqueuer1.processedEntities, enqueuer2.processedEntities,
152 "Processed element mismatch", elementEquivalence, elementFilter: (e) {
153 return elementFilter != null ? elementFilter(e) : true;
154 }, verbose: verbose);
155
156 checkSets(enqueuer1.worldBuilder.isChecks, enqueuer2.worldBuilder.isChecks, 156 checkSets(enqueuer1.worldBuilder.isChecks, enqueuer2.worldBuilder.isChecks,
157 "Is-check mismatch", typeEquivalence, 157 "Is-check mismatch", typeEquivalence,
158 verbose: verbose); 158 verbose: verbose);
159 159
160 Expect.equals(backendUsage1.isInvokeOnUsed, backendUsage2.isInvokeOnUsed, 160 Expect.equals(backendUsage1.isInvokeOnUsed, backendUsage2.isInvokeOnUsed,
161 "JavaScriptBackend.hasInvokeOnSupport mismatch"); 161 "JavaScriptBackend.hasInvokeOnSupport mismatch");
162 Expect.equals( 162 Expect.equals(
163 backendUsage1.isFunctionApplyUsed, 163 backendUsage1.isFunctionApplyUsed,
164 backendUsage1.isFunctionApplyUsed, 164 backendUsage1.isFunctionApplyUsed,
165 "JavaScriptBackend.hasFunctionApplySupport mismatch"); 165 "JavaScriptBackend.hasFunctionApplySupport mismatch");
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 472 }
473 473
474 bool areInstancesEquivalent(Instance instance1, Instance instance2, 474 bool areInstancesEquivalent(Instance instance1, Instance instance2,
475 bool typeEquivalence(DartType a, DartType b)) { 475 bool typeEquivalence(DartType a, DartType b)) {
476 InterfaceType type1 = instance1.type; 476 InterfaceType type1 = instance1.type;
477 InterfaceType type2 = instance2.type; 477 InterfaceType type2 = instance2.type;
478 return typeEquivalence(type1, type2) && 478 return typeEquivalence(type1, type2) &&
479 instance1.kind == instance2.kind && 479 instance1.kind == instance2.kind &&
480 instance1.isRedirection == instance2.isRedirection; 480 instance1.isRedirection == instance2.isRedirection;
481 } 481 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/closed_world2_test.dart ('k') | tests/compiler/dart2js/serialization/test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698