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

Unified Diff: pkg/analysis_server/test/src/plugin/notification_manager_test.dart

Issue 2842013003: Add support for watch events and error notifications (Closed)
Patch Set: fix comment Created 3 years, 8 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/src/plugin/notification_manager_test.dart
diff --git a/pkg/analysis_server/test/src/plugin/notification_manager_test.dart b/pkg/analysis_server/test/src/plugin/notification_manager_test.dart
index b37be5312481f78fdf51e5b132ff7bed100fd840..c240c695f21d411f6b7e872a3cb1ff49e3835308 100644
--- a/pkg/analysis_server/test/src/plugin/notification_manager_test.dart
+++ b/pkg/analysis_server/test/src/plugin/notification_manager_test.dart
@@ -125,6 +125,16 @@ class NotificationManagerTest extends ProtocolTestUtilities {
_verifyOutlines(fileA, serverOutline1);
}
+ void test_handlePluginNotification_pluginError() {
+ bool isFatal = false;
+ String message = 'message';
+ String stackTrace = 'stackTrace';
+ plugin.PluginErrorParams params =
+ new plugin.PluginErrorParams(isFatal, message, stackTrace);
+ manager.handlePluginNotification('a', params.toNotification());
+ _verifyPluginError(isFatal, message, stackTrace);
+ }
+
void test_recordAnalysisErrors_noSubscription() {
server.AnalysisError error = serverAnalysisError(0, 0, file: fileA);
manager.recordAnalysisErrors('a', fileA, [error]);
@@ -472,6 +482,19 @@ class NotificationManagerTest extends ProtocolTestUtilities {
expect(params.outline, equals(expectedOutline));
channel.sentNotification = null;
}
+
+ void _verifyPluginError(bool isFatal, String message, String stackTrace) {
+ server.Notification notification = channel.sentNotification;
+ expect(notification, isNotNull);
+ expect(notification.event, 'server.error');
+ server.ServerErrorParams params =
+ new server.ServerErrorParams.fromNotification(notification);
+ expect(params, isNotNull);
+ expect(params.isFatal, isFatal);
+ expect(params.message, message);
+ expect(params.stackTrace, stackTrace);
+ channel.sentNotification = null;
+ }
}
class TestChannel implements ServerCommunicationChannel {

Powered by Google App Engine
This is Rietveld 408576698