| Index: pkg/analysis_server/test/context_manager_test.dart
|
| diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
|
| index 244d9c2194466a44c3c7e3a9d3c5c3113deff900..5d87affef44c657abc9a183496563aea5cfb6dca 100644
|
| --- a/pkg/analysis_server/test/context_manager_test.dart
|
| +++ b/pkg/analysis_server/test/context_manager_test.dart
|
| @@ -129,7 +129,7 @@ class ContextManagerTest {
|
| return pumpEventQueue().then((_) {
|
| expect(manager.currentContextPaths.toList(), [projPath]);
|
| manager.now++;
|
| - manager.refresh();
|
| + manager.refresh(null);
|
| return pumpEventQueue().then((_) {
|
| expect(manager.currentContextPaths.toList(), [projPath]);
|
| expect(manager.currentContextTimestamps[projPath], manager.now);
|
| @@ -137,6 +137,31 @@ class ContextManagerTest {
|
| });
|
| }
|
|
|
| + test_refresh_oneContext() {
|
| + // create two contexts with pubspec.yaml files
|
| + String pubspecPath = posix.join(projPath, 'pubspec.yaml');
|
| + resourceProvider.newFile(pubspecPath, 'pubspec1');
|
| +
|
| + String proj2Path = '/my/proj2';
|
| + resourceProvider.newFolder(proj2Path);
|
| + String pubspec2Path = posix.join(proj2Path, 'pubspec.yaml');
|
| + resourceProvider.newFile(pubspec2Path, 'pubspec2');
|
| +
|
| + List<String> roots = <String>[projPath, proj2Path];
|
| + manager.setRoots(roots, <String>[], <String, String>{});
|
| + return pumpEventQueue().then((_) {
|
| + expect(manager.currentContextPaths.toList(), unorderedEquals(roots));
|
| + int then = manager.now;
|
| + manager.now++;
|
| + manager.refresh([resourceProvider.getResource(proj2Path)]);
|
| + return pumpEventQueue().then((_) {
|
| + expect(manager.currentContextPaths.toList(), unorderedEquals(roots));
|
| + expect(manager.currentContextTimestamps[projPath], then);
|
| + expect(manager.currentContextTimestamps[proj2Path], manager.now);
|
| + });
|
| + });
|
| + }
|
| +
|
| test_refresh_folder_with_pubspec_subfolders() {
|
| // Create a folder with no pubspec.yaml, containing two subfolders with
|
| // pubspec.yaml files.
|
| @@ -151,7 +176,7 @@ class ContextManagerTest {
|
| expect(manager.currentContextPaths.toSet(),
|
| [subdir1Path, subdir2Path, projPath].toSet());
|
| manager.now++;
|
| - manager.refresh();
|
| + manager.refresh(null);
|
| return pumpEventQueue().then((_) {
|
| expect(manager.currentContextPaths.toSet(),
|
| [subdir1Path, subdir2Path, projPath].toSet());
|
|
|