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

Unified Diff: pkg/analysis_server/test/src/plugin/plugin_manager_test.dart

Issue 2988743002: Remove the analysus.reanalyze request from the plugin API (Closed)
Patch Set: Restart plugins Created 3 years, 5 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/analysis_abstract.dart ('k') | pkg/analyzer_plugin/doc/api.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
diff --git a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
index 45867729fdd56c25b065b2a81bd91a65aa3f23ea..aa3df861b540a0875a38ed406da2499e9b852cc1 100644
--- a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
+++ b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
@@ -360,6 +360,45 @@ class PluginManagerFromDiskTest extends PluginTestSupport {
});
pkg1Dir.deleteSync(recursive: true);
}
+
+ test_restartPlugins() async {
+ io.Directory pkg1Dir = io.Directory.systemTemp.createTempSync('pkg1');
+ String pkg1Path = pkg1Dir.resolveSymbolicLinksSync();
+ io.Directory pkg2Dir = io.Directory.systemTemp.createTempSync('pkg2');
+ String pkg2Path = pkg2Dir.resolveSymbolicLinksSync();
+ await withPlugin(
+ pluginName: 'plugin1',
+ test: (String plugin1Path) async {
+ await withPlugin(
+ pluginName: 'plugin2',
+ test: (String plugin2Path) async {
+ ContextRoot contextRoot1 = new ContextRoot(pkg1Path, []);
+ ContextRoot contextRoot2 = new ContextRoot(pkg2Path, []);
+ await manager.addPluginToContextRoot(contextRoot1, plugin1Path);
+ await manager.addPluginToContextRoot(contextRoot1, plugin2Path);
+ await manager.addPluginToContextRoot(contextRoot2, plugin1Path);
+
+ await manager.restartPlugins();
+ List<PluginInfo> plugins = manager.plugins;
+ expect(plugins, hasLength(2));
+ expect(plugins[0].currentSession, isNotNull);
+ expect(plugins[1].currentSession, isNotNull);
+ if (plugins[0].pluginId.contains('plugin1')) {
+ expect(plugins[0].contextRoots,
+ unorderedEquals([contextRoot1, contextRoot2]));
+ expect(
+ plugins[1].contextRoots, unorderedEquals([contextRoot1]));
+ } else {
+ expect(
+ plugins[0].contextRoots, unorderedEquals([contextRoot1]));
+ expect(plugins[1].contextRoots,
+ unorderedEquals([contextRoot1, contextRoot2]));
+ }
+ await manager.stopAll();
+ });
+ });
+ pkg1Dir.deleteSync(recursive: true);
+ }
}
@reflectiveTest
« no previous file with comments | « pkg/analysis_server/test/analysis_abstract.dart ('k') | pkg/analyzer_plugin/doc/api.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698