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

Unified Diff: pkg/analyzer/test/generated/engine_test.dart

Issue 738673002: Use shorter DartElementLocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: pkg/analyzer/test/generated/engine_test.dart
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 04fc0d2c77002e8c223b0d0bb760255e5aad9e55..e81e8173cf50f2cc1570f15339c63856916b8030 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.dart
@@ -605,17 +605,18 @@ main() {}''');
}
void test_getElement() {
- _context = AnalysisContextFactory.contextWithCore();
- _sourceFactory = _context.sourceFactory;
- LibraryElement core =
- _context.computeLibraryElement(_sourceFactory.forUri("dart:core"));
- expect(core, isNotNull);
- ClassElement classObject =
- _findClass(core.definingCompilationUnit, "Object");
- expect(classObject, isNotNull);
- ElementLocation location = classObject.location;
+ Source source = _addSource('/test.dart', r'''
+class A {}
+class B {}
+class C {}
+''');
+ _analyzeAll_assertFinished();
+ LibraryElement library = _context.computeLibraryElement(source);
+ ClassElement classB = library.definingCompilationUnit.getType('B');
+ expect(classB, isNotNull);
+ ElementLocation location = classB.location;
Element element = _context.getElement(location);
- expect(element, same(classObject));
+ expect(element, same(classB));
}
void test_getElement_constructor_named() {
« pkg/analyzer/lib/src/generated/element.dart ('K') | « pkg/analyzer/test/generated/element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698