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

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

Issue 1759333002: Fix regression for import suggestions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 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;

Powered by Google App Engine
This is Rietveld 408576698