OLD | NEW |
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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 expect(callbacks.currentContextPaths, hasLength(0)); | 1116 expect(callbacks.currentContextPaths, hasLength(0)); |
1117 expect(callbacks.currentContextFilePaths, hasLength(0)); | 1117 expect(callbacks.currentContextFilePaths, hasLength(0)); |
1118 } | 1118 } |
1119 | 1119 |
1120 void test_setRoots_removeFolderWithPackagespec() { | 1120 void test_setRoots_removeFolderWithPackagespec() { |
1121 // create a pubspec | 1121 // create a pubspec |
1122 String pubspecPath = posix.join(projPath, '.packages'); | 1122 String pubspecPath = posix.join(projPath, '.packages'); |
1123 resourceProvider.newFile(pubspecPath, ''); | 1123 resourceProvider.newFile(pubspecPath, ''); |
1124 // add one root - there is a context | 1124 // add one root - there is a context |
1125 manager.setRoots(<String>[projPath], <String>[], <String, String>{}); | 1125 manager.setRoots(<String>[projPath], <String>[], <String, String>{}); |
| 1126 expect(manager.changeSubscriptions, hasLength(1)); |
1126 expect(callbacks.currentContextPaths, hasLength(1)); | 1127 expect(callbacks.currentContextPaths, hasLength(1)); |
1127 // set empty roots - no contexts | 1128 // set empty roots - no contexts |
1128 manager.setRoots(<String>[], <String>[], <String, String>{}); | 1129 manager.setRoots(<String>[], <String>[], <String, String>{}); |
| 1130 expect(manager.changeSubscriptions, hasLength(0)); |
1129 expect(callbacks.currentContextPaths, hasLength(0)); | 1131 expect(callbacks.currentContextPaths, hasLength(0)); |
1130 expect(callbacks.currentContextFilePaths, hasLength(0)); | 1132 expect(callbacks.currentContextFilePaths, hasLength(0)); |
1131 } | 1133 } |
1132 | 1134 |
1133 void test_setRoots_removeFolderWithPackagespecFolder() { | 1135 void test_setRoots_removeFolderWithPackagespecFolder() { |
1134 // prepare paths | 1136 // prepare paths |
1135 String projectA = '/projectA'; | 1137 String projectA = '/projectA'; |
1136 String projectB = '/projectB'; | 1138 String projectB = '/projectB'; |
1137 String subProjectA = '$projectA/sub'; | 1139 String subProjectA = '$projectA/sub'; |
1138 String subProjectB = '$projectB/sub'; | 1140 String subProjectB = '$projectB/sub'; |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1991 class TestUriResolver extends UriResolver { | 1993 class TestUriResolver extends UriResolver { |
1992 Map<Uri, Source> uriMap; | 1994 Map<Uri, Source> uriMap; |
1993 | 1995 |
1994 TestUriResolver(this.uriMap); | 1996 TestUriResolver(this.uriMap); |
1995 | 1997 |
1996 @override | 1998 @override |
1997 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 1999 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
1998 return uriMap[uri]; | 2000 return uriMap[uri]; |
1999 } | 2001 } |
2000 } | 2002 } |
OLD | NEW |