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

Unified Diff: pkg/analysis_server/test/context_manager_test.dart

Issue 1047733004: Support refresh of individual analysis roots (issue 22254) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address more comments Created 5 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 side-by-side diff with in-line comments
Download patch
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..4a4ec36fd3e4bebfc2919aa6f6bb238820ffd98c 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);
@@ -151,7 +151,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());
@@ -162,6 +162,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);
+ });
+ });
+ }
+
void test_setRoots_addFolderWithDartFile() {
String filePath = posix.join(projPath, 'foo.dart');
resourceProvider.newFile(filePath, 'contents');
« no previous file with comments | « pkg/analysis_server/test/analysis/reanalyze_test.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698