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

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

Issue 1830703002: Pass AnalysisOptions into SdkCreator, disable changing afterwards. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 testing.mock_sdk; 5 library testing.mock_sdk;
6 6
7 import 'package:analyzer/file_system/file_system.dart' as resource; 7 import 'package:analyzer/file_system/file_system.dart' as resource;
8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource;
9 import 'package:analyzer/src/context/context.dart'; 9 import 'package:analyzer/src/context/context.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 MockSdk() { 213 MockSdk() {
214 LIBRARIES.forEach((_MockSdkLibrary library) { 214 LIBRARIES.forEach((_MockSdkLibrary library) {
215 provider.newFile(library.path, library.content); 215 provider.newFile(library.path, library.content);
216 }); 216 });
217 } 217 }
218 218
219 @override 219 @override
220 AnalysisContext get context { 220 AnalysisContext get context {
221 if (_analysisContext == null) { 221 if (_analysisContext == null) {
222 _analysisContext = new SdkAnalysisContext(); 222 _analysisContext = new SdkAnalysisContext(null);
223 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); 223 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]);
224 _analysisContext.sourceFactory = factory; 224 _analysisContext.sourceFactory = factory;
225 } 225 }
226 return _analysisContext; 226 return _analysisContext;
227 } 227 }
228 228
229 @override 229 @override
230 List<SdkLibrary> get sdkLibraries => LIBRARIES; 230 List<SdkLibrary> get sdkLibraries => LIBRARIES;
231 231
232 @override 232 @override
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 bool get isInternal => shortName.startsWith('dart:_'); 332 bool get isInternal => shortName.startsWith('dart:_');
333 333
334 @override 334 @override
335 bool get isShared => throw unimplemented; 335 bool get isShared => throw unimplemented;
336 336
337 @override 337 @override
338 bool get isVmLibrary => throw unimplemented; 338 bool get isVmLibrary => throw unimplemented;
339 339
340 UnimplementedError get unimplemented => new UnimplementedError(); 340 UnimplementedError get unimplemented => new UnimplementedError();
341 } 341 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/domain_server_test.dart ('k') | pkg/analysis_server/test/socket_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698