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

Side by Side Diff: dart/tests/lib/mirrors/mirrors_test.dart

Issue 15858005: Implement get/set field in library and class mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // TODO(rmacnak): Move the existing mirror tests here (a place for 5 // TODO(rmacnak): Move the existing mirror tests here (a place for
6 // cross-implementation tests). 6 // cross-implementation tests).
7 7
8 library MirrorsTest; 8 library MirrorsTest;
9 import "dart:mirrors"; 9 import "dart:mirrors";
10 import "../../../pkg/unittest/lib/unittest.dart"; 10 import "../../../pkg/unittest/lib/unittest.dart";
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 ClassMirror valueClass = valueMirror.type; 196 ClassMirror valueClass = valueMirror.type;
197 LibraryMirror valueLibrary = valueClass.owner; 197 LibraryMirror valueLibrary = valueClass.owner;
198 expect(check(valueLibrary.uri), isTrue); 198 expect(check(valueLibrary.uri), isTrue);
199 } 199 }
200 200
201 mainWithArgument({bool isDart2js}) { 201 mainWithArgument({bool isDart2js}) {
202 var mirrors = currentMirrorSystem(); 202 var mirrors = currentMirrorSystem();
203 test("Test reflective method invocation", () { testInvoke(mirrors); }); 203 test("Test reflective method invocation", () { testInvoke(mirrors); });
204 test("Test instance field access", () { testInstanceFieldAccess(mirrors); }); 204 test("Test instance field access", () { testInstanceFieldAccess(mirrors); });
205 test('Test intercepted objects', () { testIntercepted(mirrors); }); 205 test('Test intercepted objects', () { testIntercepted(mirrors); });
206 test("Test field access", () { testFieldAccess(mirrors); });
206 if (isDart2js) return; 207 if (isDart2js) return;
207 test("Test field access", () { testFieldAccess(mirrors); });
208 test("Test closure mirrors", () { testClosureMirrors(mirrors); }); 208 test("Test closure mirrors", () { testClosureMirrors(mirrors); });
209 test("Test invoke constructor", () { testInvokeConstructor(mirrors); }); 209 test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
210 test("Test reflect type", () { testReflectClass(mirrors); }); 210 test("Test reflect type", () { testReflectClass(mirrors); });
211 test("Test simple and qualifiedName", () { testNames(mirrors); }); 211 test("Test simple and qualifiedName", () { testNames(mirrors); });
212 test("Test current library uri", () { 212 test("Test current library uri", () {
213 testLibraryUri(new Class(), 213 testLibraryUri(new Class(),
214 (Uri uri) => uri.path.endsWith('/mirrors_test.dart')); 214 (Uri uri) => uri.path.endsWith('/mirrors_test.dart'));
215 }); 215 });
216 test("Test dart library uri", () { 216 test("Test dart library uri", () {
217 testLibraryUri("test", (Uri uri) => uri == Uri.parse('dart:core')); 217 testLibraryUri("test", (Uri uri) => uri == Uri.parse('dart:core'));
218 }); 218 });
219 } 219 }
220 220
221 main() { 221 main() {
222 mainWithArgument(isDart2js: false); 222 mainWithArgument(isDart2js: false);
223 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698