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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 1405643002: Issue 24566. Main AnalysisContext.getLibrariesContaining() should work also for SDK sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index 8875d92b09d0d63f933620b11bac97f93f33b873..554bc0a544c6e88655e2925e93789702ebd3783c 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -1209,13 +1209,23 @@ Stream S = null;
// must be from SDK context
AnalysisContext sdkContext = context.sourceFactory.dartSdk.context;
expect(sdkContext, streamElement.context);
- // must be in the "async" library
Source intSource = streamElement.source;
- List<Source> coreLibraries = sdkContext.getLibrariesContaining(intSource);
- expect(coreLibraries, hasLength(1));
- Source coreSource = coreLibraries[0];
- expect(coreSource.isInSystemLibrary, isTrue);
- expect(coreSource.shortName, 'async.dart');
+ // must be in the "async" library - SDK context
+ {
+ List<Source> coreLibraries = sdkContext.getLibrariesContaining(intSource);
+ expect(coreLibraries, hasLength(1));
+ Source coreSource = coreLibraries[0];
+ expect(coreSource.isInSystemLibrary, isTrue);
+ expect(coreSource.shortName, 'async.dart');
+ }
+ // must be in the "async" library - main context
+ {
+ List<Source> coreLibraries = context.getLibrariesContaining(intSource);
+ expect(coreLibraries, hasLength(1));
+ Source coreSource = coreLibraries[0];
+ expect(coreSource.isInSystemLibrary, isTrue);
+ expect(coreSource.shortName, 'async.dart');
+ }
}
void test_getLineInfo() {
« no previous file with comments | « pkg/analyzer/lib/src/task/dart_work_manager.dart ('k') | pkg/analyzer/test/src/task/dart_work_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698