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

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

Issue 2009303002: Embedder support refactoring (phase 1). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 test.context.directory.manager; 5 library test.context.directory.manager;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analysis_server/src/context_manager.dart'; 9 import 'package:analysis_server/src/context_manager.dart';
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 expect(currentContextPaths, isNot(contains(path))); 2651 expect(currentContextPaths, isNot(contains(path)));
2652 currentContextTimestamps[path] = now; 2652 currentContextTimestamps[path] = now;
2653 currentContextFilePaths[path] = <String, int>{}; 2653 currentContextFilePaths[path] = <String, int>{};
2654 currentContextSources[path] = new HashSet<Source>(); 2654 currentContextSources[path] = new HashSet<Source>();
2655 currentContext = AnalysisEngine.instance.createAnalysisContext(); 2655 currentContext = AnalysisEngine.instance.createAnalysisContext();
2656 _locateEmbedderYamls(currentContext, disposition); 2656 _locateEmbedderYamls(currentContext, disposition);
2657 List<UriResolver> resolvers = []; 2657 List<UriResolver> resolvers = [];
2658 if (currentContext is InternalAnalysisContext) { 2658 if (currentContext is InternalAnalysisContext) {
2659 EmbedderYamlLocator embedderYamlLocator = 2659 EmbedderYamlLocator embedderYamlLocator =
2660 (currentContext as InternalAnalysisContext).embedderYamlLocator; 2660 (currentContext as InternalAnalysisContext).embedderYamlLocator;
2661 EmbedderUriResolver embedderUriResolver = 2661 EmbedderUriResolver embedderUriResolver = new EmbedderUriResolver(
2662 new EmbedderUriResolver(embedderYamlLocator.embedderYamls); 2662 new EmbedderSdk(embedderYamlLocator.embedderYamls));
2663 if (embedderUriResolver.length > 0) { 2663 if (embedderUriResolver.length > 0) {
2664 // We have some embedder dart: uri mappings, add the resolver 2664 // We have some embedder dart: uri mappings, add the resolver
2665 // to the list. 2665 // to the list.
2666 resolvers.add(embedderUriResolver); 2666 resolvers.add(embedderUriResolver);
2667 } 2667 }
2668 } 2668 }
2669 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider)); 2669 resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider));
2670 resolvers.add(new FileUriResolver()); 2670 resolvers.add(new FileUriResolver());
2671 currentContext.analysisOptions = options; 2671 currentContext.analysisOptions = options;
2672 currentContext.sourceFactory = 2672 currentContext.sourceFactory =
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 class TestUriResolver extends UriResolver { 2768 class TestUriResolver extends UriResolver {
2769 Map<Uri, Source> uriMap; 2769 Map<Uri, Source> uriMap;
2770 2770
2771 TestUriResolver(this.uriMap); 2771 TestUriResolver(this.uriMap);
2772 2772
2773 @override 2773 @override
2774 Source resolveAbsolute(Uri uri, [Uri actualUri]) { 2774 Source resolveAbsolute(Uri uri, [Uri actualUri]) {
2775 return uriMap[uri]; 2775 return uriMap[uri];
2776 } 2776 }
2777 } 2777 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698