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

Side by Side Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/LibraryElementBuilderTest.java

Issue 595513003: Version 1.7.0-dev.3.3 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, the Dart project authors. 2 * Copyright (c) 2013, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 * @param filePath the path of the file being added 166 * @param filePath the path of the file being added
167 * @param contents the contents to be returned by the content provider for the specified file 167 * @param contents the contents to be returned by the content provider for the specified file
168 * @return the source object representing the added file 168 * @return the source object representing the added file
169 */ 169 */
170 protected Source addSource(String filePath, String contents) { 170 protected Source addSource(String filePath, String contents) {
171 Source source = new FileBasedSource(createFile(filePath)); 171 Source source = new FileBasedSource(createFile(filePath));
172 context.setContents(source, contents); 172 context.setContents(source, contents);
173 return source; 173 return source;
174 } 174 }
175 175
176 @Override
177 protected void tearDown() throws Exception {
178 context = null;
179 super.tearDown();
180 }
181
176 /** 182 /**
177 * Ensure that there are elements representing all of the types in the given a rray of type names. 183 * Ensure that there are elements representing all of the types in the given a rray of type names.
178 * 184 *
179 * @param unit the compilation unit containing the types 185 * @param unit the compilation unit containing the types
180 * @param typeNames the names of the types that should be found 186 * @param typeNames the names of the types that should be found
181 */ 187 */
182 private void assertTypes(CompilationUnitElement unit, String... typeNames) { 188 private void assertTypes(CompilationUnitElement unit, String... typeNames) {
183 assertNotNull(unit); 189 assertNotNull(unit);
184 ClassElement[] types = unit.getTypes(); 190 ClassElement[] types = unit.getTypes();
185 assertLength(typeNames.length, types); 191 assertLength(typeNames.length, types);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 new Class[] {Source.class}); 224 new Class[] {Source.class});
219 method.setAccessible(true); 225 method.setAccessible(true);
220 Library library = (Library) method.invoke(resolver, librarySource); 226 Library library = (Library) method.invoke(resolver, librarySource);
221 LibraryElement element = builder.buildLibrary(library); 227 LibraryElement element = builder.buildLibrary(library);
222 GatheringErrorListener listener = new GatheringErrorListener(); 228 GatheringErrorListener listener = new GatheringErrorListener();
223 listener.addAll(resolver.getErrorListener()); 229 listener.addAll(resolver.getErrorListener());
224 listener.assertErrorsWithCodes(expectedErrorCodes); 230 listener.assertErrorsWithCodes(expectedErrorCodes);
225 return element; 231 return element;
226 } 232 }
227 } 233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698