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

Unified Diff: tests/standalone/io/http_server_socket_test.dart

Issue 11359101: Use Socket.read instead of Socket.readList in HTTP (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_server_socket_test.dart
diff --git a/tests/standalone/io/http_server_socket_test.dart b/tests/standalone/io/http_server_socket_test.dart
index a7722caa373e1918487e073b267d74b399db0950..120001caa4efbc4f01f7d0b47cd1df61c5db4716 100644
--- a/tests/standalone/io/http_server_socket_test.dart
+++ b/tests/standalone/io/http_server_socket_test.dart
@@ -84,6 +84,18 @@ class SocketMock implements Socket {
}
}
+ List<int> read([int len]) {
+ var result;
+ if (len == null) {
+ result = _data;
+ _data = [];
+ } else {
+ result = new Uint8List(len);
+ readList(result, 0, len);
+ }
+ return result;
+ }
+
int readList(List<int> buffer, int offset, int count) {
int max = min(count, _data.length);
buffer.setRange(offset, max, _data);
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698