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

Unified Diff: pkg/analysis_server/test/analysis/notification_highlights_test.dart

Issue 2934863002: Get the highlights test to work with the new driver (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/notification_highlights_test.dart
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 714ab6ba0b20943b01d224dc56f3613efd5e62be..98f5d57220eab0849193ef376cfdd063d5d68389 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -23,9 +23,7 @@ main() {
@reflectiveTest
class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
List<HighlightRegion> regions;
-
- @override
- bool get enableNewAnalysisDriver => false;
+ Completer _regionsAvailable = new Completer();
void assertHasRawRegion(HighlightRegionType type, int offset, int length) {
for (HighlightRegion region in regions) {
@@ -93,7 +91,14 @@ class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
Future prepareHighlights() {
addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
- return waitForTasksFinished();
+ // The test would time out if the notification was not received soon enough,
+ // but the time-out is painfully long, so we provide a shorter timeout here.
+ new Future.delayed(new Duration(seconds: 2), () {
+ if (!_regionsAvailable.isCompleted) {
+ _regionsAvailable.complete(null);
+ }
+ });
+ return _regionsAvailable.future;
}
void processNotification(Notification notification) {
@@ -101,6 +106,7 @@ class AnalysisNotificationHighlightsTest extends AbstractAnalysisTest {
var params = new AnalysisHighlightsParams.fromNotification(notification);
if (params.file == testFile) {
regions = params.regions;
+ _regionsAvailable.complete(null);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698