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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java

Issue 14007011: Test clean-up (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/TypePropagationTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java (revision 21622)
+++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/context/AnalysisContextFactory.java (working copy)
@@ -14,10 +14,15 @@
package com.google.dart.engine.context;
import com.google.dart.engine.element.ClassElement;
+import com.google.dart.engine.element.FunctionElement;
import com.google.dart.engine.element.LibraryElement;
+import com.google.dart.engine.element.MethodElement;
+import com.google.dart.engine.element.TopLevelVariableElement;
import com.google.dart.engine.internal.context.AnalysisContextImpl;
+import com.google.dart.engine.internal.element.ClassElementImpl;
import com.google.dart.engine.internal.element.CompilationUnitElementImpl;
import com.google.dart.engine.internal.element.LibraryElementImpl;
+import com.google.dart.engine.internal.element.TopLevelVariableElementImpl;
import com.google.dart.engine.internal.resolver.TestTypeProvider;
import com.google.dart.engine.sdk.DartSdk;
import com.google.dart.engine.sdk.DirectoryBasedDartSdk;
@@ -25,8 +30,14 @@
import com.google.dart.engine.source.FileUriResolver;
import com.google.dart.engine.source.Source;
import com.google.dart.engine.source.SourceFactory;
+import com.google.dart.engine.type.InterfaceType;
+import com.google.dart.engine.type.Type;
import static com.google.dart.engine.ast.ASTFactory.libraryIdentifier;
+import static com.google.dart.engine.element.ElementFactory.classElement;
+import static com.google.dart.engine.element.ElementFactory.functionElement;
+import static com.google.dart.engine.element.ElementFactory.methodElement;
+import static com.google.dart.engine.element.ElementFactory.topLevelVariableElement;
import java.util.HashMap;
@@ -69,6 +80,27 @@
CompilationUnitElementImpl htmlUnit = new CompilationUnitElementImpl("html_dartium.dart");
Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
htmlUnit.setSource(htmlSource);
+ ClassElementImpl elementElement = classElement("Element");
+ InterfaceType elementType = elementElement.getType();
+ ClassElementImpl documentElement = classElement("Document", elementType);
+ ClassElementImpl htmlDocumentElement = classElement("HtmlDocument", documentElement.getType());
+ htmlDocumentElement.setMethods(new MethodElement[] {methodElement(
+ "query",
+ elementType,
+ new Type[] {provider.getStringType()})});
+ htmlUnit.setTypes(new ClassElement[] {
+ classElement("AnchorElement", elementType), classElement("BodyElement", elementType),
+ classElement("ButtonElement", elementType), classElement("DivElement", elementType),
+ documentElement, elementElement, htmlDocumentElement,
+ classElement("InputElement", elementType), classElement("SelectElement", elementType),});
+ htmlUnit.setFunctions(new FunctionElement[] {functionElement(
+ "query",
+ elementElement,
+ new ClassElement[] {provider.getStringType().getElement()},
+ ClassElementImpl.EMPTY_ARRAY)});
+ TopLevelVariableElementImpl document = topLevelVariableElement("document");
+ document.setType(htmlDocumentElement.getType());
+ htmlUnit.setTopLevelVariables(new TopLevelVariableElement[] {document});
LibraryElementImpl htmlLibrary = new LibraryElementImpl(context, libraryIdentifier(
"dart",
"dom",
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/TypePropagationTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698