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

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

Issue 1303343008: Extension point for AnalysisResultListener(s). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Replace with SetAnalysisDomain() function. Created 5 years, 3 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/analysis_abstract.dart
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 539f71843f9ca8e36d663f913c0325f6a831884a..6ec38be56f173241b696f6702fd0f6643119abaf 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -16,6 +16,7 @@ import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/file_system/memory_file_system.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:plugin/manager.dart';
+import 'package:plugin/plugin.dart';
import 'package:unittest/unittest.dart';
import 'mock_sdk.dart';
@@ -83,6 +84,8 @@ class AbstractAnalysisTest {
handleSuccessfulRequest(request);
}
+ void addServerPlugins(List<Plugin> plugins) {}
+
String addTestFile(String content) {
addFile(testFile, content);
this.testCode = content;
@@ -90,12 +93,22 @@ class AbstractAnalysisTest {
}
AnalysisServer createAnalysisServer(Index index) {
- ExtensionManager manager = new ExtensionManager();
ServerPlugin serverPlugin = new ServerPlugin();
- manager.processPlugins([serverPlugin]);
- return new AnalysisServer(serverChannel, resourceProvider,
- packageMapProvider, index, serverPlugin, new AnalysisServerOptions(),
- new MockSdk(), InstrumentationService.NULL_SERVICE);
+ List<Plugin> plugins = <Plugin>[serverPlugin];
+ addServerPlugins(plugins);
+ // process plugins
+ ExtensionManager manager = new ExtensionManager();
+ manager.processPlugins(plugins);
+ // create server
+ return new AnalysisServer(
+ serverChannel,
+ resourceProvider,
+ packageMapProvider,
+ index,
+ serverPlugin,
+ new AnalysisServerOptions(),
+ new MockSdk(),
+ InstrumentationService.NULL_SERVICE);
}
Index createIndex() {
@@ -169,7 +182,7 @@ class AbstractAnalysisTest {
packageMapProvider = new MockPackageMapProvider();
Index index = createIndex();
server = createAnalysisServer(index);
- handler = new AnalysisDomainHandler(server);
+ handler = server.handlers.singleWhere((_) => _ is AnalysisDomainHandler);
Brian Wilkerson 2015/09/04 16:54:31 I think the standard convention is to use '_' only
// listen for notifications
Stream<Notification> notificationStream =
serverChannel.notificationController.stream;
« no previous file with comments | « pkg/analysis_server/lib/src/plugin/server_plugin.dart ('k') | pkg/analysis_server/test/plugin/set_analysis_domain_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698