| Index: pkg/analyzer/test/generated/resolver_test_case.dart
|
| diff --git a/pkg/analyzer/test/generated/resolver_test_case.dart b/pkg/analyzer/test/generated/resolver_test_case.dart
|
| index 1b7f5e2c0429b74d5f83f5d23be45d2ff0e9089b..0e493044e9a40575ed181c13cab1b7697033b526 100644
|
| --- a/pkg/analyzer/test/generated/resolver_test_case.dart
|
| +++ b/pkg/analyzer/test/generated/resolver_test_case.dart
|
| @@ -9,6 +9,7 @@ import 'package:analyzer/dart/ast/visitor.dart';
|
| import 'package:analyzer/dart/element/element.dart';
|
| import 'package:analyzer/dart/element/type.dart';
|
| import 'package:analyzer/error/error.dart';
|
| +import 'package:analyzer/file_system/memory_file_system.dart';
|
| import 'package:analyzer/file_system/physical_file_system.dart';
|
| import 'package:analyzer/src/dart/element/element.dart';
|
| import 'package:analyzer/src/dart/element/type.dart';
|
| @@ -299,6 +300,11 @@ class ResolutionVerifier extends RecursiveAstVisitor<Object> {
|
|
|
| class ResolverTestCase extends EngineTestCase {
|
| /**
|
| + * The resource provider used by the test case.
|
| + */
|
| + MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
|
| +
|
| + /**
|
| * The analysis context used to parse the compilation units being resolved.
|
| */
|
| InternalAnalysisContext analysisContext2;
|
| @@ -332,14 +338,13 @@ class ResolverTestCase extends EngineTestCase {
|
| TypeSystem get typeSystem => analysisContext2.typeSystem;
|
|
|
| /**
|
| - * Add a source file to the content provider. The file path should be absolute.
|
| - *
|
| - * @param filePath the path of the file being added
|
| - * @param contents the contents to be returned by the content provider for the specified file
|
| - * @return the source object representing the added file
|
| + * Add a source file with the given [filePath] in the root of the file system.
|
| + * The file path should be absolute. The file will have the given [contents]
|
| + * set in the content provider. Return the source representing the added file.
|
| */
|
| Source addNamedSource(String filePath, String contents) {
|
| - Source source = cacheSource(filePath, contents);
|
| + Source source =
|
| + cacheSource(resourceProvider.convertPath(filePath), contents);
|
| ChangeSet changeSet = new ChangeSet();
|
| changeSet.addedSource(source);
|
| analysisContext2.applyChanges(changeSet);
|
| @@ -347,10 +352,9 @@ class ResolverTestCase extends EngineTestCase {
|
| }
|
|
|
| /**
|
| - * Add a source file to the content provider.
|
| - *
|
| - * @param contents the contents to be returned by the content provider for the specified file
|
| - * @return the source object representing the added file
|
| + * Add a source file named 'test.dart' in the root of the file system. The
|
| + * file will have the given [contents] set in the content provider. Return the
|
| + * source representing the added file.
|
| */
|
| Source addSource(String contents) => addNamedSource("/test.dart", contents);
|
|
|
| @@ -614,21 +618,20 @@ class ResolverTestCase extends EngineTestCase {
|
| }
|
|
|
| /**
|
| - * In the rare cases we want to group several tests into single "test_" method, so need a way to
|
| - * reset test instance to reuse it.
|
| + * Re-create the analysis context being used by the test case.
|
| */
|
| void reset() {
|
| - analysisContext2 = AnalysisContextFactory.contextWithCore();
|
| + analysisContext2 = AnalysisContextFactory.contextWithCore(
|
| + resourceProvider: resourceProvider);
|
| }
|
|
|
| /**
|
| - * Reset the analysis context to have the given options applied.
|
| - *
|
| - * @param options the analysis options to be applied to the context
|
| + * Re-create the analysis context being used by the test case and set the
|
| + * [options] in the newly created context to the given [options].
|
| */
|
| void resetWithOptions(AnalysisOptions options) {
|
| - analysisContext2 =
|
| - AnalysisContextFactory.contextWithCoreAndOptions(options);
|
| + analysisContext2 = AnalysisContextFactory.contextWithCoreAndOptions(options,
|
| + resourceProvider: resourceProvider);
|
| }
|
|
|
| /**
|
|
|