| 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:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 11 import 'package:analyzer/src/generated/engine.dart'; | 11 import 'package:analyzer/src/generated/engine.dart'; |
| 12 import 'package:analyzer/src/generated/sdk.dart'; | 12 import 'package:analyzer/src/generated/sdk.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:analyzer/src/generated/source_io.dart'; | 14 import 'package:analyzer/src/generated/source_io.dart'; |
| 15 import 'package:analyzer/src/util/glob.dart'; | 15 import 'package:analyzer/src/util/glob.dart'; |
| 16 import 'package:linter/src/plugin/linter_plugin.dart'; | 16 import 'package:linter/src/plugin/linter_plugin.dart'; |
| 17 import 'package:path/path.dart'; | 17 import 'package:path/path.dart'; |
| 18 import 'package:plugin/manager.dart'; | 18 import 'package:plugin/manager.dart'; |
| 19 import 'package:plugin/plugin.dart'; | 19 import 'package:plugin/plugin.dart'; |
| 20 import 'package:test/test.dart'; | 20 import 'package:test/test.dart'; |
| 21 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 21 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 22 | 22 |
| 23 import 'context_manager_test.dart' show TestContextManagerCallbacks; | 23 import 'context_manager_test.dart' show TestContextManagerCallbacks; |
| 24 import 'mock_sdk.dart'; | |
| 25 import 'mocks.dart'; | 24 import 'mocks.dart'; |
| 26 | 25 |
| 27 main() { | 26 main() { |
| 28 defineReflectiveSuite(() { | 27 defineReflectiveSuite(() { |
| 29 defineReflectiveTests(SingleContextManagerTest); | 28 defineReflectiveTests(SingleContextManagerTest); |
| 30 }); | 29 }); |
| 31 } | 30 } |
| 32 | 31 |
| 33 @reflectiveTest | 32 @reflectiveTest |
| 34 class SingleContextManagerTest { | 33 class SingleContextManagerTest { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 57 String newFolder(List<String> pathComponents) { | 56 String newFolder(List<String> pathComponents) { |
| 58 String folderPath = posix.joinAll(pathComponents); | 57 String folderPath = posix.joinAll(pathComponents); |
| 59 resourceProvider.newFolder(folderPath); | 58 resourceProvider.newFolder(folderPath); |
| 60 return folderPath; | 59 return folderPath; |
| 61 } | 60 } |
| 62 | 61 |
| 63 void setUp() { | 62 void setUp() { |
| 64 packageResolver = new TestUriResolver(); | 63 packageResolver = new TestUriResolver(); |
| 65 | 64 |
| 66 _processRequiredPlugins(); | 65 _processRequiredPlugins(); |
| 67 DartSdkManager sdkManager = | 66 DartSdkManager sdkManager = new DartSdkManager('', false); |
| 68 new DartSdkManager('', false, (_) => new MockSdk()); | |
| 69 manager = new SingleContextManager(resourceProvider, sdkManager, | 67 manager = new SingleContextManager(resourceProvider, sdkManager, |
| 70 (_) => packageResolver, analysisFilesGlobs, new AnalysisOptionsImpl()); | 68 (_) => packageResolver, analysisFilesGlobs, new AnalysisOptionsImpl()); |
| 71 callbacks = new TestContextManagerCallbacks(resourceProvider); | 69 callbacks = new TestContextManagerCallbacks(resourceProvider); |
| 72 manager.callbacks = callbacks; | 70 manager.callbacks = callbacks; |
| 73 } | 71 } |
| 74 | 72 |
| 75 void test_isIgnored_false() { | 73 void test_isIgnored_false() { |
| 76 String project = '/project'; | 74 String project = '/project'; |
| 77 resourceProvider.newFolder(project); | 75 resourceProvider.newFolder(project); |
| 78 manager.setRoots(<String>[project], <String>[], <String, String>{}); | 76 manager.setRoots(<String>[project], <String>[], <String, String>{}); |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 manager.processPlugins(plugins); | 539 manager.processPlugins(plugins); |
| 542 } | 540 } |
| 543 } | 541 } |
| 544 | 542 |
| 545 class TestUriResolver extends UriResolver { | 543 class TestUriResolver extends UriResolver { |
| 546 @override | 544 @override |
| 547 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 545 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 548 return null; | 546 return null; |
| 549 } | 547 } |
| 550 } | 548 } |
| OLD | NEW |