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

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

Issue 894323003: Wait for analysis in search domain. Rewrite with async/await. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 b167e77e06eeb1b2ef61f8bc141bfe063a12d77e..453e5828221997559b5f3c4dcb4c659aaf217163 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -34,7 +34,6 @@ int findIdentifierLength(String search) {
}
-
/**
* An abstract base for all 'analysis' domain tests.
*/
@@ -52,12 +51,8 @@ class AbstractAnalysisTest {
String testFile = '/project/bin/test.dart';
String testCode;
-// Map<String, List<AnalysisError>> filesErrors = {};
-// Map<String, List<Map<String, Object>>> filesHighlights = {};
-// Map<String, List<Map<String, Object>>> filesNavigation = {};
-
-
AbstractAnalysisTest();
+
void addAnalysisSubscription(AnalysisService service, String file) {
// add file to subscription
var files = analysisSubscriptions[service];
@@ -145,95 +140,9 @@ class AbstractAnalysisTest {
return testFile;
}
-// /**
-// * Returns [AnalysisError]s recorded for the given [file].
-// * May be empty, but not `null`.
-// */
-// List<AnalysisError> getErrors(String file) {
-// List<AnalysisError> errors = filesErrors[file];
-// if (errors != null) {
-// return errors;
-// }
-// return <AnalysisError>[];
-// }
-//
-// /**
-// * Returns highlights recorded for the given [file].
-// * May be empty, but not `null`.
-// */
-// List<Map<String, Object>> getHighlights(String file) {
-// List<Map<String, Object>> highlights = filesHighlights[file];
-// if (highlights != null) {
-// return highlights;
-// }
-// return [];
-// }
-//
-// /**
-// * Returns navigation regions recorded for the given [file].
-// * May be empty, but not `null`.
-// */
-// List<Map<String, Object>> getNavigation(String file) {
-// List<Map<String, Object>> navigation = filesNavigation[file];
-// if (navigation != null) {
-// return navigation;
-// }
-// return [];
-// }
-//
-// /**
-// * Returns [AnalysisError]s recorded for the [testFile].
-// * May be empty, but not `null`.
-// */
-// List<AnalysisError> getTestErrors() {
-// return getErrors(testFile);
-// }
-//
-// /**
-// * Returns highlights recorded for the given [testFile].
-// * May be empty, but not `null`.
-// */
-// List<Map<String, Object>> getTestHighlights() {
-// return getHighlights(testFile);
-// }
-//
-// /**
-// * Returns navigation information recorded for the given [testFile].
-// * May be empty, but not `null`.
-// */
-// List<Map<String, Object>> getTestNavigation() {
-// return getNavigation(testFile);
-// }
-
void processNotification(Notification notification) {
-// if (notification.event == NOTIFICATION_ERRORS) {
-// String file = notification.getParameter(FILE);
-// List<Map<String, Object>> errorMaps = notification.getParameter(ERRORS);
-// filesErrors[file] = errorMaps.map(jsonToAnalysisError).toList();
-// }
-// if (notification.event == NOTIFICATION_HIGHLIGHTS) {
-// String file = notification.getParameter(FILE);
-// filesHighlights[file] = notification.getParameter(REGIONS);
-// }
-// if (notification.event == NOTIFICATION_NAVIGATION) {
-// String file = notification.getParameter(FILE);
-// filesNavigation[file] = notification.getParameter(REGIONS);
-// }
}
-// /**
-// * Creates a project with a single Dart file `/project/bin/test.dart` with
-// * the given [code].
-// */
-// void createSingleFileProject(code) {
-// this.testCode = _getCodeString(code);
-// resourceProvider.newFolder('/project');
-// resourceProvider.newFile(testFile, testCode);
-// Request request = new AnalysisSetAnalysisRootsParams(['/project'],
-// []).toRequest('0');
-// handleSuccessfulRequest(request);
-// }
-
void setUp() {
serverChannel = new MockServerChannel();
resourceProvider = new MemoryResourceProvider();
@@ -263,4 +172,12 @@ class AbstractAnalysisTest {
Future waitForTasksFinished() {
return server.onAnalysisComplete;
}
+
+ /**
+ * Completes with a successful [Response] for the given [request].
+ * Otherwise fails.
+ */
+ Future<Response> waitResponse(Request request) async {
+ return serverChannel.sendRequest(request);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698