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

Side by Side Diff: pkg/analysis_server/test/abstract_context.dart

Issue 1468623002: Revert "Fix test failures on the bots" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library testing.abstract_context; 5 library testing.abstract_context;
6 6
7 import 'package:analyzer/file_system/file_system.dart'; 7 import 'package:analyzer/file_system/file_system.dart';
8 import 'package:analyzer/file_system/memory_file_system.dart'; 8 import 'package:analyzer/file_system/memory_file_system.dart';
9 import 'package:analyzer/source/package_map_resolver.dart'; 9 import 'package:analyzer/source/package_map_resolver.dart';
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
11 import 'package:analyzer/src/generated/element.dart'; 11 import 'package:analyzer/src/generated/element.dart';
12 import 'package:analyzer/src/generated/engine.dart'; 12 import 'package:analyzer/src/generated/engine.dart';
13 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException; 13 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
14 import 'package:analyzer/src/generated/sdk.dart'; 14 import 'package:analyzer/src/generated/sdk.dart';
15 import 'package:analyzer/src/generated/source_io.dart'; 15 import 'package:analyzer/src/generated/source_io.dart';
16 import 'package:plugin/manager.dart';
17 16
18 import 'mock_sdk.dart'; 17 import 'mock_sdk.dart';
19 18
20 /** 19 /**
21 * Finds an [Element] with the given [name]. 20 * Finds an [Element] with the given [name].
22 */ 21 */
23 Element findChildElement(Element root, String name, [ElementKind kind]) { 22 Element findChildElement(Element root, String name, [ElementKind kind]) {
24 Element result = null; 23 Element result = null;
25 root.accept(new _ElementVisitorFunctionWrapper((Element element) { 24 root.accept(new _ElementVisitorFunctionWrapper((Element element) {
26 if (element.name != name) { 25 if (element.name != name) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 77
79 CompilationUnit resolveDartUnit(Source unitSource, Source librarySource) { 78 CompilationUnit resolveDartUnit(Source unitSource, Source librarySource) {
80 return context.resolveCompilationUnit2(unitSource, librarySource); 79 return context.resolveCompilationUnit2(unitSource, librarySource);
81 } 80 }
82 81
83 CompilationUnit resolveLibraryUnit(Source source) { 82 CompilationUnit resolveLibraryUnit(Source source) {
84 return context.resolveCompilationUnit2(source, source); 83 return context.resolveCompilationUnit2(source, source);
85 } 84 }
86 85
87 void setUp() { 86 void setUp() {
88 ExtensionManager extensionManager = new ExtensionManager();
89 extensionManager.processPlugins(AnalysisEngine.instance.supportedPlugins);
90 setupResourceProvider(); 87 setupResourceProvider();
91 resourceResolver = new ResourceUriResolver(provider); 88 resourceResolver = new ResourceUriResolver(provider);
92 packageMap = new Map<String, List<Folder>>(); 89 packageMap = new Map<String, List<Folder>>();
93 PackageMapUriResolver packageResolver = 90 PackageMapUriResolver packageResolver =
94 new PackageMapUriResolver(provider, packageMap); 91 new PackageMapUriResolver(provider, packageMap);
95 context = AnalysisEngine.instance.createAnalysisContext(); 92 context = AnalysisEngine.instance.createAnalysisContext();
96 context.sourceFactory = 93 context.sourceFactory =
97 new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]); 94 new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]);
98 AnalysisEngine.instance.logger = PrintLogger.instance; 95 AnalysisEngine.instance.logger = PrintLogger.instance;
99 } 96 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 * [engine.GeneralizingElementVisitor]. 150 * [engine.GeneralizingElementVisitor].
154 */ 151 */
155 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { 152 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor {
156 final _ElementVisitorFunction function; 153 final _ElementVisitorFunction function;
157 _ElementVisitorFunctionWrapper(this.function); 154 _ElementVisitorFunctionWrapper(this.function);
158 visitElement(Element element) { 155 visitElement(Element element) {
159 function(element); 156 function(element);
160 super.visitElement(element); 157 super.visitElement(element);
161 } 158 }
162 } 159 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698