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

Unified Diff: tests/lib/mirrors/parameter_of_mixin_app_constructor_test.dart

Issue 212883009: Handle creating ParameterMirrors for the parameters of forwarding constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« runtime/vm/object.cc ('K') | « tests/lib/mirrors/immutable_collections_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/parameter_of_mixin_app_constructor_test.dart
diff --git a/tests/lib/mirrors/parameter_of_mixin_app_constructor_test.dart b/tests/lib/mirrors/parameter_of_mixin_app_constructor_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2065043ccaee44f0b4ccd76af6fb0255cca97b70
--- /dev/null
+++ b/tests/lib/mirrors/parameter_of_mixin_app_constructor_test.dart
@@ -0,0 +1,58 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.parameter_of_mixin_app_constructor;
+
+import 'dart:mirrors';
+import 'stringify.dart';
+
+class MapView {
+ final _map;
+ MapView(map) : this._map = map;
+}
+
+abstract class UnmodifiableMapMixin {
+ someFunctionality() {}
+}
+
+class UnmodifiableMapView1 extends MapView with UnmodifiableMapMixin {
+ UnmodifiableMapView1(map1) : super(map1);
+}
+
+class UnmodifiableMapView2 = MapView with UnmodifiableMapMixin;
+
+expectParameters(MethodMirror mm, List parameterNames) {
+ Expect.listEquals(mm, )
+}
+
+soleConstructorOf(ClassMirror cm) {
+ return cm.declarations.values
+ .where((dm) => dm is MethodMirror && dm.isConstructor).single;
+}
+
+main() {
+ ClassMirror umv1 = reflectClass(UnmodifiableMapView1);
+ expect('[Parameter(s(map1) in s(UnmodifiableMapView1),'
+ ' type = Type(s(dynamic), top-level))]',
+ soleConstructorOf(umv1).parameters);
+ expect('[Parameter(s(map) in s(test.parameter_of_mixin_app_constructor.MapView'
+ ' with test.parameter_of_mixin_app_constructor.UnmodifiableMapMixin),'
+ ' type = Type(s(dynamic), top-level))]',
+ soleConstructorOf(umv1.superclass).parameters);
+ expect('[Parameter(s(map) in s(MapView),'
+ ' type = Type(s(dynamic), top-level))]',
+ soleConstructorOf(umv1.superclass.superclass).parameters);
+ expect('[]',
+ soleConstructorOf(umv1.superclass.superclass.superclass).parameters);
+
+ ClassMirror umv2 = reflectClass(UnmodifiableMapView2);
+ expect('[Parameter(s(map) in s(UnmodifiableMapView2),'
+ ' type = Type(s(dynamic), top-level))]',
+ soleConstructorOf(umv2).parameters);
+ expect('[Parameter(s(map) in s(MapView),'
+ ' type = Type(s(dynamic), top-level))]',
+ soleConstructorOf(umv2.superclass).parameters);
+ expect('[]',
+ soleConstructorOf(umv2.superclass.superclass).parameters);
+}
« runtime/vm/object.cc ('K') | « tests/lib/mirrors/immutable_collections_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698