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

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

Issue 2681783005: Support mixin application equivalence in impact_test. (Closed)
Patch Set: Created 3 years, 10 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 | « tests/compiler/dart2js/kernel/impact_test.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/test_helper.dart
diff --git a/tests/compiler/dart2js/serialization/test_helper.dart b/tests/compiler/dart2js/serialization/test_helper.dart
index 7d32dd7aa0969cffd450fa346dd9ba3f59203456..b0603fed7c62c3ef92bd5505cbe0b37bc4724010 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -663,6 +663,29 @@ class KernelEquivalence {
return false;
case ElementKind.CLASS:
if (b is KClass) {
+ List<InterfaceType> aMixinTypes = [];
+ List<InterfaceType> bMixinTypes = [];
+ ClassElement aClass = a;
+ while (aClass.isMixinApplication) {
+ MixinApplicationElement aMixinApplication = aClass;
+ aMixinTypes.add(aMixinApplication.mixinType);
+ aClass = aMixinApplication.superclass;
+ }
+ KClass bClass = b;
+ while (bClass != null) {
+ InterfaceType mixinType = testing.getMixinTypeForClass(bClass);
+ if (mixinType == null) break;
+ bMixinTypes.add(mixinType);
+ bClass = testing.getSuperclassForClass(bClass);
+ }
+ if (aMixinTypes.isNotEmpty || aMixinTypes.isNotEmpty) {
+ if (aClass.isNamedMixinApplication &&
+ !strategy.test(a, b, 'name', a.name, b.name)) {
+ return false;
+ }
+ return strategy.testTypeLists(
+ a, b, 'mixinTypes', aMixinTypes, bMixinTypes);
+ }
return strategy.test(a, b, 'name', a.name, b.name) &&
strategy.testElements(
a, b, 'library', a.library, testing.getLibraryForClass(b));
« no previous file with comments | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698