| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.analysis_server.src.single_context_manager; | 5 library test.analysis_server.src.single_context_manager; |
| 6 | 6 |
| 7 import 'dart:core'; | 7 import 'dart:core'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/single_context_manager.dart'; | 9 import 'package:analysis_server/src/single_context_manager.dart'; |
| 10 import 'package:analysis_server/src/utilities/null_string_sink.dart'; |
| 10 import 'package:analyzer/file_system/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 12 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 11 import 'package:analyzer/src/generated/engine.dart'; | 13 import 'package:analyzer/src/generated/engine.dart'; |
| 12 import 'package:analyzer/src/generated/sdk.dart'; | 14 import 'package:analyzer/src/generated/sdk.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:analyzer/src/generated/source_io.dart'; | 16 import 'package:analyzer/src/generated/source_io.dart'; |
| 15 import 'package:analyzer/src/util/glob.dart'; | 17 import 'package:analyzer/src/util/glob.dart'; |
| 16 import 'package:linter/src/plugin/linter_plugin.dart'; | 18 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 17 import 'package:path/path.dart' as path; | 19 import 'package:path/path.dart' as path; |
| 18 import 'package:plugin/manager.dart'; | 20 import 'package:plugin/manager.dart'; |
| 19 import 'package:plugin/plugin.dart'; | 21 import 'package:plugin/plugin.dart'; |
| 20 import 'package:test/test.dart'; | 22 import 'package:test/test.dart'; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return folderPath; | 61 return folderPath; |
| 60 } | 62 } |
| 61 | 63 |
| 62 void setUp() { | 64 void setUp() { |
| 63 packageResolver = new TestUriResolver(); | 65 packageResolver = new TestUriResolver(); |
| 64 | 66 |
| 65 _processRequiredPlugins(); | 67 _processRequiredPlugins(); |
| 66 DartSdkManager sdkManager = new DartSdkManager('', false); | 68 DartSdkManager sdkManager = new DartSdkManager('', false); |
| 67 manager = new SingleContextManager(resourceProvider, sdkManager, | 69 manager = new SingleContextManager(resourceProvider, sdkManager, |
| 68 (_) => packageResolver, analysisFilesGlobs, new AnalysisOptionsImpl()); | 70 (_) => packageResolver, analysisFilesGlobs, new AnalysisOptionsImpl()); |
| 69 callbacks = new TestContextManagerCallbacks(resourceProvider); | 71 PerformanceLog logger = new PerformanceLog(new NullStringSink()); |
| 72 AnalysisDriverScheduler scheduler = new AnalysisDriverScheduler(logger); |
| 73 callbacks = |
| 74 new TestContextManagerCallbacks(resourceProvider, logger, scheduler); |
| 70 manager.callbacks = callbacks; | 75 manager.callbacks = callbacks; |
| 71 } | 76 } |
| 72 | 77 |
| 73 void test_isIgnored_false() { | 78 void test_isIgnored_false() { |
| 74 String project = '/project'; | 79 String project = '/project'; |
| 75 resourceProvider.newFolder(project); | 80 resourceProvider.newFolder(project); |
| 76 manager.setRoots(<String>[project], <String>[], <String, String>{}); | 81 manager.setRoots(<String>[project], <String>[], <String, String>{}); |
| 77 expect(manager.isIgnored('$project/file.dart'), isFalse); | 82 expect(manager.isIgnored('$project/file.dart'), isFalse); |
| 78 } | 83 } |
| 79 | 84 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 manager.processPlugins(plugins); | 544 manager.processPlugins(plugins); |
| 540 } | 545 } |
| 541 } | 546 } |
| 542 | 547 |
| 543 class TestUriResolver extends UriResolver { | 548 class TestUriResolver extends UriResolver { |
| 544 @override | 549 @override |
| 545 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 550 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 546 return null; | 551 return null; |
| 547 } | 552 } |
| 548 } | 553 } |
| OLD | NEW |