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 8286482bca0d77ea29fe27d3efc68c23b4d2da6c..a0aae0125d79723c881831bd07f340abf3a70bb0 100644 |
--- a/pkg/analysis_server/test/analysis_abstract.dart |
+++ b/pkg/analysis_server/test/analysis_abstract.dart |
@@ -64,6 +64,9 @@ class AbstractAnalysisTest { |
AbstractAnalysisTest(); |
+ AnalysisDomainHandler get analysisHandler => server.handlers |
+ .singleWhere((handler) => handler is AnalysisDomainHandler); |
+ |
void addAnalysisSubscription(AnalysisService service, String file) { |
// add file to subscription |
var files = analysisSubscriptions[service]; |
@@ -143,7 +146,7 @@ class AbstractAnalysisTest { |
resourceProvider.newFolder(projectPath); |
Request request = |
new AnalysisSetAnalysisRootsParams([projectPath], []).toRequest('0'); |
- handleSuccessfulRequest(request); |
+ handleSuccessfulRequest(request, handler: analysisHandler); |
} |
/** |
@@ -171,7 +174,8 @@ class AbstractAnalysisTest { |
/** |
* Validates that the given [request] is handled successfully. |
*/ |
- Response handleSuccessfulRequest(Request request) { |
+ Response handleSuccessfulRequest(Request request, {RequestHandler handler}) { |
+ handler ??= this.handler; |
Response response = handler.handleRequest(request); |
expect(response, isResponseSuccess(request.id)); |
return response; |
@@ -203,8 +207,7 @@ class AbstractAnalysisTest { |
packageMapProvider = new MockPackageMapProvider(); |
Index index = createIndex(); |
server = createAnalysisServer(index); |
- handler = server.handlers |
- .singleWhere((handler) => handler is AnalysisDomainHandler); |
+ handler = analysisHandler; |
// listen for notifications |
Stream<Notification> notificationStream = |
serverChannel.notificationController.stream; |