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

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

Issue 582753002: dart2js: add --preserve-uris flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update tests. Created 6 years, 2 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
« no previous file with comments | « tests/lib/mirrors/library_uri_package_test.dart ('k') | tests/lib/mirrors/null_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library MirrorsTest; 5 library MirrorsTest;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 8
9 import '../../light_unittest.dart'; 9 import '../../light_unittest.dart';
10 10
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 expect(variableMirror.simpleName, equals(#field)); 200 expect(variableMirror.simpleName, equals(#field));
201 expect(variableMirror.qualifiedName, 201 expect(variableMirror.qualifiedName,
202 equals(const Symbol('MirrorsTest.Class.field'))); 202 equals(const Symbol('MirrorsTest.Class.field')));
203 } 203 }
204 204
205 testLibraryUri(var value, bool check(Uri)) { 205 testLibraryUri(var value, bool check(Uri)) {
206 var valueMirror = reflect(value); 206 var valueMirror = reflect(value);
207 ClassMirror valueClass = valueMirror.type; 207 ClassMirror valueClass = valueMirror.type;
208 LibraryMirror valueLibrary = valueClass.owner; 208 LibraryMirror valueLibrary = valueClass.owner;
209 expect(check(valueLibrary.uri), isTrue); 209 Uri uri = valueLibrary.uri;
210 if (uri.scheme != "https" ||
211 uri.host != "dartlang.org" ||
212 uri.path != "/dart2js-stripped-uri") {
213 expect(check(uri), isTrue);
214 }
210 } 215 }
211 216
212 main() { 217 main() {
213 var mirrors = currentMirrorSystem(); 218 var mirrors = currentMirrorSystem();
214 test("Test reflective method invocation", () { testInvoke(mirrors); }); 219 test("Test reflective method invocation", () { testInvoke(mirrors); });
215 test('Test intercepted objects', () { testIntercepted(mirrors); }); 220 test('Test intercepted objects', () { testIntercepted(mirrors); });
216 test("Test field access", () { testFieldAccess(mirrors); }); 221 test("Test field access", () { testFieldAccess(mirrors); });
217 test("Test closure mirrors", () { testClosureMirrors(mirrors); }); 222 test("Test closure mirrors", () { testClosureMirrors(mirrors); });
218 test("Test invoke constructor", () { testInvokeConstructor(mirrors); }); 223 test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
219 test("Test current library uri", () { 224 test("Test current library uri", () {
220 testLibraryUri(new Class(), 225 testLibraryUri(new Class(),
221 // TODO(floitsch): change this to "/mirrors_test.dart" when 226 // TODO(floitsch): change this to "/mirrors_test.dart" when
222 // dart2js_mirrors_test.dart has been removed. 227 // dart2js_mirrors_test.dart has been removed.
223 (Uri uri) => uri.path.endsWith('mirrors_test.dart')); 228 (Uri uri) => uri.path.endsWith('mirrors_test.dart'));
224 }); 229 });
225 test("Test dart library uri", () { 230 test("Test dart library uri", () {
226 testLibraryUri("test", 231 testLibraryUri("test",
227 (Uri uri) { 232 (Uri uri) {
228 if (uri == Uri.parse('dart:core')) return true; 233 if (uri == Uri.parse('dart:core')) return true;
229 // TODO(floitsch): do we want to fake the interceptors to 234 // TODO(floitsch): do we want to fake the interceptors to
230 // be in dart:core? 235 // be in dart:core?
231 return (uri == Uri.parse('dart:_interceptors')); 236 return (uri == Uri.parse('dart:_interceptors'));
232 }); 237 });
233 }); 238 });
234 test("Test simple and qualifiedName", () { testNames(mirrors); }); 239 test("Test simple and qualifiedName", () { testNames(mirrors); });
235 test("Test reflect type", () { testReflectClass(mirrors); }); 240 test("Test reflect type", () { testReflectClass(mirrors); });
236 } 241 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/library_uri_package_test.dart ('k') | tests/lib/mirrors/null_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698