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

Side by Side Diff: pkg/analysis_server/bin/fuzz/byte_stream_channel.dart

Issue 584963002: first cut fuzz test for analysis server (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 channel.byte_stream; 5 library channel.byte_stream;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
11 import 'package:analysis_server/src/channel/channel.dart'; 11 import 'channel.dart';
12 import 'package:analysis_server/src/protocol.dart'; 12 import 'protocol.dart';
13 13
14 /** 14 /**
15 * Instances of the class [ByteStreamClientChannel] implement a 15 * Instances of the class [ByteStreamClientChannel] implement a
16 * [ClientCommunicationChannel] that uses a stream and a sink (typically, 16 * [ClientCommunicationChannel] that uses a stream and a sink (typically,
17 * standard input and standard output) to communicate with servers. 17 * standard input and standard output) to communicate with servers.
18 */ 18 */
19 class ByteStreamClientChannel implements ClientCommunicationChannel { 19 class ByteStreamClientChannel implements ClientCommunicationChannel {
20 final Stream input; 20 final Stream input;
21 final IOSink output; 21 final IOSink output;
22 22
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Parse the string as a JSON descriptor and process the resulting 128 // Parse the string as a JSON descriptor and process the resulting
129 // structure as a request. 129 // structure as a request.
130 Request request = new Request.fromString(data); 130 Request request = new Request.fromString(data);
131 if (request == null) { 131 if (request == null) {
132 sendResponse(new Response.invalidRequestFormat()); 132 sendResponse(new Response.invalidRequestFormat());
133 return; 133 return;
134 } 134 }
135 onRequest(request); 135 onRequest(request);
136 } 136 }
137 } 137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698