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

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

Issue 1487953002: Clean-up the registration of plugins (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/domain_diagnostic_test.dart
diff --git a/pkg/analysis_server/test/domain_diagnostic_test.dart b/pkg/analysis_server/test/domain_diagnostic_test.dart
index 444e6cffddd12368987fea49c6c1c4f662276534..0e8fd2ad91835275417d71439d01ccf2b55e6347 100644
--- a/pkg/analysis_server/test/domain_diagnostic_test.dart
+++ b/pkg/analysis_server/test/domain_diagnostic_test.dart
@@ -10,7 +10,9 @@ import 'package:analysis_server/src/domain_diagnostic.dart';
import 'package:analysis_server/src/plugin/server_plugin.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:analyzer/src/generated/engine.dart';
import 'package:plugin/manager.dart';
+import 'package:plugin/plugin.dart';
import 'package:unittest/unittest.dart';
import 'mock_sdk.dart';
@@ -25,11 +27,25 @@ main() {
initializeTestEnvironment();
setUp(() {
+ //
+ // Collect plugins
+ //
+ ServerPlugin serverPlugin = new ServerPlugin();
+ List<Plugin> plugins = <Plugin>[];
+ plugins.addAll(AnalysisEngine.instance.requiredPlugins);
+ plugins.add(AnalysisEngine.instance.commandLinePlugin);
+ plugins.add(AnalysisEngine.instance.optionsPlugin);
+ plugins.add(serverPlugin);
+ //
+ // Process plugins
+ //
+ ExtensionManager manager = new ExtensionManager();
+ manager.processPlugins(plugins);
+ //
+ // Create the server
+ //
var serverChannel = new MockServerChannel();
resourceProvider = new MemoryResourceProvider();
- ExtensionManager manager = new ExtensionManager();
- ServerPlugin serverPlugin = new ServerPlugin();
- manager.processPlugins([serverPlugin]);
server = new AnalysisServer(
serverChannel,
resourceProvider,
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | pkg/analysis_server/test/services/completion/optype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698