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

Side by Side Diff: pkg/analysis_server/lib/src/protocol.dart

Issue 227713004: Improve analysis_server/protocol.dart test coverage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 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 protocol; 5 library protocol;
6 6
7 import 'dart:convert' show JsonDecoder; 7 import 'dart:convert' show JsonDecoder;
8 8
9 /** 9 /**
10 * Instances of the class [Request] represent a request that was received. 10 * Instances of the class [Request] represent a request that was received.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 * by a [request] referencing a context that does not exist. 218 * by a [request] referencing a context that does not exist.
219 */ 219 */
220 Response.contextDoesNotExist(Request request) 220 Response.contextDoesNotExist(Request request)
221 : this(request.id, new RequestError(-1, 'Context does not exist')); 221 : this(request.id, new RequestError(-1, 'Context does not exist'));
222 222
223 /** 223 /**
224 * Initialize a newly created instance to represent an error condition caused 224 * Initialize a newly created instance to represent an error condition caused
225 * by a [request] that was expected to have a boolean-valued parameter but was 225 * by a [request] that was expected to have a boolean-valued parameter but was
226 * passed a non-boolean value. 226 * passed a non-boolean value.
227 */ 227 */
228 Response.expectedBoolean(Request request, String value) 228 Response.expectedBoolean(Request request, Object value)
229 : this(request.id, new RequestError(-2, 'Expected a boolean value, but found "$value"')); 229 : this(request.id, new RequestError(-2, 'Expected a boolean value, but found "$value"'));
230 230
231 /** 231 /**
232 * Initialize a newly created instance to represent an error condition caused 232 * Initialize a newly created instance to represent an error condition caused
233 * by a [request] that was expected to have a integer-valued parameter but was 233 * by a [request] that was expected to have a integer-valued parameter but was
234 * passed a non-integer value. 234 * passed a non-integer value.
235 */ 235 */
236 Response.expectedInteger(Request request, String value) 236 Response.expectedInteger(Request request, Object value)
237 : this(request.id, new RequestError(-3, 'Expected an integer value, but foun d "$value"')); 237 : this(request.id, new RequestError(-3, 'Expected an integer value, but foun d "$value"'));
238 238
239 /** 239 /**
240 * Initialize a newly created instance to represent an error condition caused 240 * Initialize a newly created instance to represent an error condition caused
241 * by a malformed request. 241 * by a malformed request.
242 */ 242 */
243 Response.invalidRequestFormat() 243 Response.invalidRequestFormat()
244 : this('', new RequestError(-4, 'Invalid request')); 244 : this('', new RequestError(-4, 'Invalid request'));
245 245
246 /** 246 /**
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 /** 584 /**
585 * The response to be returned as a result of the failure. 585 * The response to be returned as a result of the failure.
586 */ 586 */
587 final Response response; 587 final Response response;
588 588
589 /** 589 /**
590 * Initialize a newly created exception to return the given reponse. 590 * Initialize a newly created exception to return the given reponse.
591 */ 591 */
592 RequestFailure(this.response); 592 RequestFailure(this.response);
593 } 593 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/protocol_test.dart » ('j') | pkg/analysis_server/test/protocol_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698