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

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

Issue 1467623002: 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/sdk.dart'; 13 import 'package:analyzer/src/generated/sdk.dart';
14 import 'package:analyzer/src/generated/source_io.dart'; 14 import 'package:analyzer/src/generated/source_io.dart';
15 import 'package:plugin/manager.dart';
15 16
16 import 'mock_sdk.dart'; 17 import 'mock_sdk.dart';
17 18
18 /** 19 /**
19 * Finds an [Element] with the given [name]. 20 * Finds an [Element] with the given [name].
20 */ 21 */
21 Element findChildElement(Element root, String name, [ElementKind kind]) { 22 Element findChildElement(Element root, String name, [ElementKind kind]) {
22 Element result = null; 23 Element result = null;
23 root.accept(new _ElementVisitorFunctionWrapper((Element element) { 24 root.accept(new _ElementVisitorFunctionWrapper((Element element) {
24 if (element.name != name) { 25 if (element.name != name) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 CompilationUnit resolveDartUnit(Source unitSource, Source librarySource) { 78 CompilationUnit resolveDartUnit(Source unitSource, Source librarySource) {
78 return context.resolveCompilationUnit2(unitSource, librarySource); 79 return context.resolveCompilationUnit2(unitSource, librarySource);
79 } 80 }
80 81
81 CompilationUnit resolveLibraryUnit(Source source) { 82 CompilationUnit resolveLibraryUnit(Source source) {
82 return context.resolveCompilationUnit2(source, source); 83 return context.resolveCompilationUnit2(source, source);
83 } 84 }
84 85
85 void setUp() { 86 void setUp() {
87 ExtensionManager extensionManager = new ExtensionManager();
88 extensionManager.processPlugins(AnalysisEngine.instance.supportedPlugins);
86 setupResourceProvider(); 89 setupResourceProvider();
87 resourceResolver = new ResourceUriResolver(provider); 90 resourceResolver = new ResourceUriResolver(provider);
88 packageMap = new Map<String, List<Folder>>(); 91 packageMap = new Map<String, List<Folder>>();
89 PackageMapUriResolver packageResolver = 92 PackageMapUriResolver packageResolver =
90 new PackageMapUriResolver(provider, packageMap); 93 new PackageMapUriResolver(provider, packageMap);
91 context = AnalysisEngine.instance.createAnalysisContext(); 94 context = AnalysisEngine.instance.createAnalysisContext();
92 context.sourceFactory = 95 context.sourceFactory =
93 new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]); 96 new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]);
94 } 97 }
95 98
(...skipping 12 matching lines...) Expand all
108 * [engine.GeneralizingElementVisitor]. 111 * [engine.GeneralizingElementVisitor].
109 */ 112 */
110 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { 113 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor {
111 final _ElementVisitorFunction function; 114 final _ElementVisitorFunction function;
112 _ElementVisitorFunctionWrapper(this.function); 115 _ElementVisitorFunctionWrapper(this.function);
113 visitElement(Element element) { 116 visitElement(Element element) {
114 function(element); 117 function(element);
115 super.visitElement(element); 118 super.visitElement(element);
116 } 119 }
117 } 120 }
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