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

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

Issue 1920993002: Support for replacing of the context folder. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « pkg/analysis_server/test/context_manager_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/single_context_manager_test.dart
diff --git a/pkg/analysis_server/test/single_context_manager_test.dart b/pkg/analysis_server/test/single_context_manager_test.dart
index 68a43763aedff597c354dca78fdda123a438c6ff..b1f20f0c966b1de63543a20bfd10a143a8544cba 100644
--- a/pkg/analysis_server/test/single_context_manager_test.dart
+++ b/pkg/analysis_server/test/single_context_manager_test.dart
@@ -76,7 +76,7 @@ class SingleContextManagerTest {
return new MockSdk();
});
manager = new SingleContextManager(resourceProvider, sdkManager,
- _providePackageResolver, analysisFilesGlobs);
+ () => packageResolver, analysisFilesGlobs);
callbacks = new TestContextManagerCallbacks(resourceProvider);
manager.callbacks = callbacks;
resourceProvider.newFolder(projPath);
@@ -247,6 +247,32 @@ class SingleContextManagerTest {
callbacks.assertContextFiles(project, [fileA, fileB]);
}
+ void test_setRoots_newContextFolder_replace() {
+ String contextPath1 = '/context1';
+ String root11 = '$contextPath1/root1';
+ String root12 = '$contextPath1/root2';
+ String file11 = '$root11/file1.dart';
+ String file12 = '$root12/file2.dart';
+ String contextPath2 = '/context2';
+ String root21 = '$contextPath2/root1';
+ String root22 = '$contextPath2/root2';
+ String file21 = '$root21/file1.dart';
+ String file22 = '$root22/file2.dart';
+ // create files
+ resourceProvider.newFile(file11, '');
+ resourceProvider.newFile(file12, '');
+ resourceProvider.newFile(file21, '');
+ resourceProvider.newFile(file22, '');
+ // set roots in '/context1'
+ manager.setRoots(<String>[root11, root12], <String>[], <String, String>{});
+ callbacks.assertContextPaths([contextPath1]);
+ callbacks.assertContextFiles(contextPath1, [file11, file12]);
+ // set roots in '/context2'
+ manager.setRoots(<String>[root21, root22], <String>[], <String, String>{});
+ callbacks.assertContextPaths([contextPath2]);
+ callbacks.assertContextFiles(contextPath2, [file21, file22]);
+ }
+
void test_setRoots_pathContainsDotFile() {
// If the path to a file (relative to the context root) contains a folder
// whose name begins with '.', then the file is ignored.
@@ -281,8 +307,6 @@ class SingleContextManagerTest {
ExtensionManager manager = new ExtensionManager();
manager.processPlugins(plugins);
}
-
- UriResolver _providePackageResolver(Folder folder) => packageResolver;
}
class TestUriResolver extends UriResolver {
« no previous file with comments | « pkg/analysis_server/test/context_manager_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698