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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1180673008: Create LibraryElement with SDK context for SDK sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rollback model.dart change. Created 5 years, 6 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 | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 2a9fca8309b6a3ba13300eb33bfca39d6518b2f5..9ebd8b9947864a074a7a26847b5429e189f51e1f 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -12,6 +12,7 @@ import 'package:analyzer/src/generated/engine.dart'
show AnalysisOptionsImpl, CacheState;
import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/task/dart.dart';
import 'package:analyzer/task/dart.dart';
@@ -399,6 +400,22 @@ library libB;
}
}
+ test_perform_dartCoreContext() {
+ List<Source> sources = newSources({'/libA.dart': ''});
+ Source source = sources[0];
+ // perform task
+ _computeResult(source, LIBRARY_ELEMENT2);
+ expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+ // prepare outputs
+ LibraryElement libraryElement = outputs[LIBRARY_ELEMENT2];
+ // verify that dart:core has SDK context
+ {
+ LibraryElement coreLibrary = libraryElement.importedLibraries[0];
+ DartSdk dartSdk = context.sourceFactory.dartSdk;
+ expect(coreLibrary.context, same(dartSdk.context));
+ }
+ }
+
test_perform_error_exportOfNonLibrary() {
List<Source> sources = newSources({
'/libA.dart': '''
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698