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

Unified Diff: tests/compiler/dart2js/serialization/model_test.dart

Issue 1961323002: Register mixin use from modelz. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/model_test.dart
diff --git a/tests/compiler/dart2js/serialization/model_test.dart b/tests/compiler/dart2js/serialization/model_test.dart
index 0229b02604595f85fd629e3dae4cfa2daafa6107..1bbcc86f2f0fca2a73783ee4e99f9d45b6a745c6 100644
--- a/tests/compiler/dart2js/serialization/model_test.dart
+++ b/tests/compiler/dart2js/serialization/model_test.dart
@@ -66,6 +66,7 @@ Future check(
options: [Flags.analyzeOnly]);
compilerNormal.resolution.retainCachesForTesting = true;
await compilerNormal.run(entryPoint);
+ compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING;
compilerNormal.world.populate();
print('------------------------------------------------------------------');
@@ -77,6 +78,7 @@ Future check(
compilerDeserialized.resolution.retainCachesForTesting = true;
deserialize(compilerDeserialized, serializedData);
await compilerDeserialized.run(entryPoint);
+ compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING;
compilerDeserialized.world.populate();
checkAllImpacts(
@@ -116,12 +118,31 @@ Future check(
compilerNormal.coreClasses.objectClass),
compilerDeserialized.world.getClassHierarchyNode(
compilerDeserialized.coreClasses.objectClass),
+ onClasses: (a, b) {
+ checkMixinUses(
+ compilerNormal, compilerDeserialized, a, b, verbose: verbose);
+ },
verbose: verbose);
}
+void checkMixinUses(
+ Compiler compiler1, Compiler compiler2,
+ ClassElement class1, ClassElement class2,
+ {bool verbose: false}) {
+
+ checkSets(
+ compiler1.world.mixinUsesOf(class1),
+ compiler2.world.mixinUsesOf(class2),
+ "Mixin uses of $class1 vs $class2",
+ areElementsEquivalent,
+ verbose: verbose);
+
+}
+
void checkClassHierarchyNodes(
ClassHierarchyNode a, ClassHierarchyNode b,
- {bool verbose: false}) {
+ {void onClasses(ClassElement a, ClassElement b),
+ bool verbose: false}) {
if (verbose) {
print('Checking $a vs $b');
}
@@ -144,7 +165,7 @@ void checkClassHierarchyNodes(
for (ClassHierarchyNode other in b.directSubclasses) {
if (areElementsEquivalent(child.cls, other.cls)) {
checkClassHierarchyNodes(child, other,
- verbose: verbose);
+ onClasses: onClasses, verbose: verbose);
found = true;
break;
}
@@ -154,6 +175,7 @@ void checkClassHierarchyNodes(
child.isInstantiated, 'Missing subclass ${child.cls} of ${a.cls}');
}
}
+ onClasses(a.cls, b.cls);
Siggi Cherem (dart-lang) 2016/05/10 17:17:48 nit: the `onClasses` callback argument feels like
Johnni Winther 2016/05/11 07:53:12 Done.
}
void checkSets(
« no previous file with comments | « pkg/compiler/lib/src/world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698