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

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

Issue 1164223002: Fix several tests when the new task model is enabled (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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/generated/testing/test_type_provider.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/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 22faa578a47dab9c671dd3e9ae69a613ab661f51..5929e066c4da39e6b09412101805d0bf30a2d4a9 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -127,6 +127,7 @@ class AnalysisContextFactory {
coreContext.setContents(coreSource, "");
coreUnit.librarySource = coreUnit.source = coreSource;
ClassElementImpl proxyClassElement = ElementFactory.classElement2("_Proxy");
+ ClassElement objectClassElement = provider.objectType.element;
coreUnit.types = <ClassElement>[
provider.boolType.element,
provider.deprecatedType.element,
@@ -139,7 +140,7 @@ class AnalysisContextFactory {
provider.mapType.element,
provider.nullType.element,
provider.numType.element,
- provider.objectType.element,
+ objectClassElement,
proxyClassElement,
provider.stackTraceType.element,
provider.stringType.element,
@@ -148,18 +149,19 @@ class AnalysisContextFactory {
];
coreUnit.functions = <FunctionElement>[
ElementFactory.functionElement3("identical", provider.boolType.element,
- <ClassElement>[
- provider.objectType.element,
- provider.objectType.element
- ], null),
+ <ClassElement>[objectClassElement, objectClassElement], null),
ElementFactory.functionElement3("print", VoidTypeImpl.instance.element,
- <ClassElement>[provider.objectType.element], null)
+ <ClassElement>[objectClassElement], null)
];
TopLevelVariableElement proxyTopLevelVariableElt = ElementFactory
.topLevelVariableElement3("proxy", true, false, proxyClassElement.type);
- TopLevelVariableElement deprecatedTopLevelVariableElt = ElementFactory
- .topLevelVariableElement3(
+ ConstTopLevelVariableElementImpl deprecatedTopLevelVariableElt =
+ ElementFactory.topLevelVariableElement3(
"deprecated", true, false, provider.deprecatedType);
+ deprecatedTopLevelVariableElt.constantInitializer = AstFactory
+ .instanceCreationExpression2(Keyword.CONST,
+ AstFactory.typeName(provider.deprecatedType.element),
+ [AstFactory.string2('next release')]);
coreUnit.accessors = <PropertyAccessorElement>[
proxyTopLevelVariableElt.getter,
deprecatedTopLevelVariableElt.getter
@@ -7998,27 +8000,25 @@ class ResolverTestCase extends EngineTestCase {
}
/**
- * Verify that all of the identifiers in the compilation units associated with the given sources
- * have been resolved.
- *
- * @param resolvedElementMap a table mapping the AST nodes that have been resolved to the element
- * to which they were resolved
- * @param sources the sources identifying the compilation units to be verified
- * @throws Exception if the contents of the compilation unit cannot be accessed
+ * Verify that all of the identifiers in the compilation units associated with
+ * the given [sources] have been resolved.
*/
void verify(List<Source> sources) {
ResolutionVerifier verifier = new ResolutionVerifier();
for (Source source in sources) {
- analysisContext2.parseCompilationUnit(source).accept(verifier);
+ List<Source> libraries = analysisContext2.getLibrariesContaining(source);
+ for (Source library in libraries) {
+ analysisContext2
+ .resolveCompilationUnit2(source, library)
+ .accept(verifier);
+ }
}
verifier.assertResolved();
}
/**
- * Create a source object representing a file with the given name and give it an empty content.
- *
- * @param fileName the name of the file for which a source is to be created
- * @return the source that was created
+ * Create a source object representing a file with the given [fileName] and
+ * give it an empty content. Return the source that was created.
*/
FileBasedSource _createNamedSource(String fileName) {
FileBasedSource source =
« no previous file with comments | « pkg/analyzer/lib/src/generated/testing/test_type_provider.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698