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

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

Issue 298823007: add server.status notification (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove print statement Created 6 years, 7 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 | « pkg/analysis_server/lib/src/get_handler.dart ('k') | 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_server_test.dart
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 326ce3f679e18128bea92cf7ce95971243f30049..41c37f1ea82615e81f4a816cacff0d9cf94fffdf 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -82,17 +82,35 @@ class AnalysisServerTest {
// new AnalysisResult(null, 0, null, 0));
// return pumpEventQueue().then((_) {
// context.getLogs(callsTo('performAnalysisTask')).verify(happenedExactly(2));
-// var notifications = channel.notificationsReceived;
-// expect(notifications, hasLength(2));
+// List<Notification> notifications = channel.notificationsReceived;
+// expect(notifications, hasLength(4));
+//
// expect(notifications[0].event, equals('server.connected'));
-// expect(notifications[1].event, equals('context.errors'));
-// expect(notifications[1].params['source'], equals('foo.dart'));
-// expect(notifications[1].params['contextId'], equals('context-27'));
-// List<AnalysisError> errors = notifications[1].params['errors'];
+//
+// assertStatusNotification(notifications[1], true);
+//
+// expect(notifications[2].event, equals('context.errors'));
+// expect(notifications[2].params['source'], equals('foo.dart'));
+// expect(notifications[2].params['contextId'], equals('context-27'));
+// List<AnalysisError> errors = notifications[2].params['errors'];
// expect(errors, hasLength(1));
// expect(errors[0], equals(AnalysisServer.errorToJson(analysisError)));
+//
+// assertStatusNotification(notifications[3], false);
// });
// }
+//
+// static void assertStatusNotification(Notification notification, bool expectAnalyzing) {
+// expect(notification.event, equals('server.status'));
+// Map<String, Object> analysis = notification.params['analysis'];
+// expect(analysis['analyzing'], expectAnalyzing);
+// expect(analysis.containsKey('analysisTarget'), expectAnalyzing);
+// if (expectAnalyzing) {
+// var analysisTarget = analysis['analysisTarget'];
+// expect((analysisTarget is String), isTrue);
+// expect(analysisTarget.length > 0, isTrue);
+// }
+// }
static Future addContextToWorkQueue_twice() {
// TODO(scheglov) remove after implementing "setAnalysisRoots" API
« no previous file with comments | « pkg/analysis_server/lib/src/get_handler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698