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

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

Issue 299513003: improve analysis server notifications (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove analysis.complete notification 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/domain_server.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 c946d596b707f8f576d346b5d30b1291bac319d1..c79f3c84f08c61773e0e681765d7639f6502a81c 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -65,6 +65,7 @@ class AnalysisServerTest {
static Future addContextToWorkQueue_whenRunning() {
MockAnalysisContext context = new MockAnalysisContext();
server.addContextToWorkQueue(context);
+ server.contextIdMap[context] = 'context-27';
MockSource source = new MockSource();
source.when(callsTo('get encoding')).alwaysReturn('foo.dart');
ChangeNoticeImpl changeNoticeImpl = new ChangeNoticeImpl(source);
@@ -78,14 +79,13 @@ class AnalysisServerTest {
new AnalysisResult(null, 0, null, 0));
return pumpEventQueue().then((_) {
context.getLogs(callsTo('performAnalysisTask')).verify(happenedExactly(2));
- expect(channel.notificationsReceived, hasLength(2));
- expect(channel.notificationsReceived[0].event, equals('server.connected')
- );
- expect(channel.notificationsReceived[1].event, equals('context.errors'));
- expect(channel.notificationsReceived[1].params['source'], equals(
- 'foo.dart'));
- List<AnalysisError> errors =
- channel.notificationsReceived[1].params['errors'];
+ var notifications = channel.notificationsReceived;
+ expect(notifications, hasLength(2));
+ 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'];
expect(errors, hasLength(1));
expect(errors[0], equals(AnalysisServer.errorToJson(analysisError)));
});
« no previous file with comments | « pkg/analysis_server/lib/src/domain_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698