| 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 d4d31319514ec9f35a2c7f811383c3ea1f1cba4c..8875d92b09d0d63f933620b11bac97f93f33b873 100644
|
| --- a/pkg/analyzer/test/src/context/context_test.dart
|
| +++ b/pkg/analyzer/test/src/context/context_test.dart
|
| @@ -1191,6 +1191,33 @@ export 'libA.dart';''');
|
| fail("The added source was not in the list of library sources");
|
| }
|
|
|
| + void test_getLibrarySources_inSDK() {
|
| + Source source = addSource(
|
| + '/test.dart',
|
| + r'''
|
| +import 'dart:async';
|
| +Stream S = null;
|
| +''');
|
| + LibraryElement testLibrary = context.computeLibraryElement(source);
|
| + // prepare "Stream" ClassElement
|
| + ClassElement streamElement;
|
| + {
|
| + CompilationUnitElement testUnit = testLibrary.definingCompilationUnit;
|
| + InterfaceType streamType = testUnit.topLevelVariables[0].type;
|
| + streamElement = streamType.element;
|
| + }
|
| + // 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');
|
| + }
|
| +
|
| void test_getLineInfo() {
|
| Source source = addSource(
|
| "/test.dart",
|
|
|