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

Side by Side Diff: pkg/analysis_server/test/socket_server_test.dart

Issue 513853002: In the analysis server API, change RequestError.code to an enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.socket.server; 5 library test.socket.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'mocks.dart'; 9 import 'mocks.dart';
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 MockServerChannel channel1 = new MockServerChannel(); 44 MockServerChannel channel1 = new MockServerChannel();
45 MockServerChannel channel2 = new MockServerChannel(); 45 MockServerChannel channel2 = new MockServerChannel();
46 server.createAnalysisServer(channel1); 46 server.createAnalysisServer(channel1);
47 expect(channel1.notificationsReceived[0].event, SERVER_CONNECTED); 47 expect(channel1.notificationsReceived[0].event, SERVER_CONNECTED);
48 server.createAnalysisServer(channel2); 48 server.createAnalysisServer(channel2);
49 channel1.expectMsgCount(notificationCount: 1); 49 channel1.expectMsgCount(notificationCount: 1);
50 channel2.expectMsgCount(responseCount: 1); 50 channel2.expectMsgCount(responseCount: 1);
51 expect(channel2.responsesReceived[0].id, equals('')); 51 expect(channel2.responsesReceived[0].id, equals(''));
52 expect(channel2.responsesReceived[0].error, isNotNull); 52 expect(channel2.responsesReceived[0].error, isNotNull);
53 expect(channel2.responsesReceived[0].error.code, equals( 53 expect(channel2.responsesReceived[0].error.code, equals(
54 RequestError.CODE_SERVER_ALREADY_STARTED)); 54 RequestErrorCode.SERVER_ALREADY_STARTED));
55 channel2.sendRequest(new ServerShutdownParams().toRequest('0')).then( 55 channel2.sendRequest(new ServerShutdownParams().toRequest('0')).then(
56 (Response response) { 56 (Response response) {
57 expect(response.id, equals('0')); 57 expect(response.id, equals('0'));
58 expect(response.error, isNotNull); 58 expect(response.error, isNotNull);
59 expect(response.error.code, equals( 59 expect(response.error.code, equals(
60 RequestError.CODE_SERVER_ALREADY_STARTED)); 60 RequestErrorCode.SERVER_ALREADY_STARTED));
61 channel2.expectMsgCount(responseCount: 2); 61 channel2.expectMsgCount(responseCount: 2);
62 }); 62 });
63 } 63 }
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698