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

Unified Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 13797002: Change MirrorSystem.libraries to Map<Uri, String> (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 8 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/mirrors_metadata_test.dart ('k') | utils/apidoc/apidoc.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 2c056baf3dd1c9da834285d77bc0720edbfbb7c5..6726116581f961c8675dd7b2b04873cf4f4e1283 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -8,6 +8,10 @@ import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.
import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
import 'dart:io';
+import 'dart:uri';
+
+const Uri DART_MIRRORS_URI =
+ const Uri.fromComponents(scheme: 'dart', path: 'mirrors');
int count(Iterable iterable) {
var count = 0;
@@ -26,7 +30,7 @@ bool containsType(TypeMirror expected, Iterable<TypeMirror> iterable) {
return false;
}
-DeclarationMirror findMirror(List<DeclarationMirror> list, String name) {
+DeclarationMirror findMirror(Iterable<DeclarationMirror> list, String name) {
for (DeclarationMirror mirror in list) {
if (mirror.simpleName == name) {
return mirror;
@@ -54,12 +58,13 @@ void test(MirrorSystem mirrors) {
Expect.isNotNull(libraries, "No libraries map returned");
Expect.isFalse(libraries.isEmpty, "Empty libraries map returned");
- var helperLibrary = libraries["mirrors_helper"];
+ var helperLibrary = findMirror(libraries.values, "mirrors_helper");
Expect.isNotNull(helperLibrary, "Library 'mirrors_helper' not found");
Expect.stringEquals("mirrors_helper", helperLibrary.simpleName,
"Unexpected library simple name");
Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName,
"Unexpected library qualified name");
+ Expect.equals(helperLibrary, mirrors.findLibrary('mirrors_helper').single);
var helperLibraryLocation = helperLibrary.location;
Expect.isNotNull(helperLibraryLocation);
@@ -181,7 +186,7 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
var metadataListIndex = 0;
var metadata;
- var dartMirrorsLibrary = system.libraries['dart.mirrors'];
+ var dartMirrorsLibrary = system.libraries[DART_MIRRORS_URI];
Expect.isNotNull(dartMirrorsLibrary);
var commentType = dartMirrorsLibrary.classes['Comment'];
Expect.isNotNull(commentType);
« no previous file with comments | « tests/compiler/dart2js/mirrors_metadata_test.dart ('k') | utils/apidoc/apidoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698