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

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

Issue 1302333006: Support metadata on patches. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove partial renaming Created 5 years, 3 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
Index: tests/compiler/dart2js/metadata_test.dart
diff --git a/tests/compiler/dart2js/metadata_test.dart b/tests/compiler/dart2js/metadata_test.dart
index b304b4f418369d16f4104915a9143247339146a7..205c897fd2a8ce7acef50bd3cd7b97fb7c7ce0e7 100644
--- a/tests/compiler/dart2js/metadata_test.dart
+++ b/tests/compiler/dart2js/metadata_test.dart
@@ -33,9 +33,9 @@ void checkAnnotation(String name, String declaration,
compileAndCheck(source1, name, (compiler, element) {
compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(1, length(element.metadata),
+ Expect.equals(1, element.metadata.length,
'Unexpected metadata count on $element.');
- PartialMetadataAnnotation annotation = element.metadata.head;
+ PartialMetadataAnnotation annotation = element.metadata.first;
annotation.ensureResolved(compiler);
PrimitiveConstantValue value =
compiler.constants.getConstantValue(annotation.constant);
@@ -53,9 +53,9 @@ void checkAnnotation(String name, String declaration,
compileAndCheck(source2, name, (compiler, element) {
compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(2, length(element.metadata));
- PartialMetadataAnnotation annotation1 = element.metadata.head;
- PartialMetadataAnnotation annotation2 = element.metadata.tail.head;
+ Expect.equals(2, element.metadata.length);
+ PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
+ PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
annotation1.ensureResolved(compiler);
annotation2.ensureResolved(compiler);
Expect.isFalse(identical(annotation1, annotation2),
@@ -86,12 +86,12 @@ void checkAnnotation(String name, String declaration,
compileAndCheck(source3, 'Foo', (compiler, element) {
compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(0, length(element.metadata));
+ Expect.equals(0, element.metadata.length);
element.ensureResolved(compiler);
- Expect.equals(0, length(element.metadata));
+ Expect.equals(0, element.metadata.length);
element = element.lookupLocalMember(name);
- Expect.equals(1, length(element.metadata));
- PartialMetadataAnnotation annotation = element.metadata.head;
+ Expect.equals(1, element.metadata.length);
+ PartialMetadataAnnotation annotation = element.metadata.first;
annotation.ensureResolved(compiler);
PrimitiveConstantValue value =
compiler.constants.getConstantValue(annotation.constant);
@@ -111,13 +111,13 @@ void checkAnnotation(String name, String declaration,
compileAndCheck(source4, 'Foo', (compiler, element) {
compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(0, length(element.metadata));
+ Expect.equals(0, element.metadata.length);
element.ensureResolved(compiler);
- Expect.equals(0, length(element.metadata));
+ Expect.equals(0, element.metadata.length);
element = element.lookupLocalMember(name);
- Expect.equals(2, length(element.metadata));
- PartialMetadataAnnotation annotation1 = element.metadata.head;
- PartialMetadataAnnotation annotation2 = element.metadata.tail.head;
+ Expect.equals(2, element.metadata.length);
+ PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
+ PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
annotation1.ensureResolved(compiler);
annotation2.ensureResolved(compiler);
Expect.isFalse(identical(annotation1, annotation2),
@@ -152,7 +152,7 @@ void testTopLevelFieldMetadata() {
void testLibraryTags() {
void compileAndCheckLibrary(
String source,
- Link<MetadataAnnotation> extractMetadata(LibraryElement element)) {
+ List<MetadataAnnotation> extractMetadata(LibraryElement element)) {
Uri partUri = new Uri(scheme: 'source', path: 'part.dart');
String partSource = '@native part of foo;';
@@ -170,10 +170,10 @@ void testLibraryTags() {
LibraryElement element = compiler.libraryLoader.lookupLibrary(uri);
Expect.isNotNull(element, 'Cannot find $uri');
- Link<MetadataAnnotation> metadata = extractMetadata(element);
- Expect.equals(1, length(metadata));
+ List<MetadataAnnotation> metadata = extractMetadata(element);
+ Expect.equals(1, metadata.length);
- PartialMetadataAnnotation annotation = metadata.head;
+ PartialMetadataAnnotation annotation = metadata.first;
annotation.ensureResolved(compiler);
PrimitiveConstantValue value =
compiler.constants.getConstantValue(annotation.constant);

Powered by Google App Engine
This is Rietveld 408576698