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

Side by Side Diff: tests/standalone/io/http_read_test.dart

Issue 14640008: Change the signature for all network bind calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by whesse@ Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 void init() { 120 void init() {
121 // Setup request handlers. 121 // Setup request handlers.
122 _requestHandlers = new Map(); 122 _requestHandlers = new Map();
123 _requestHandlers["/echo"] = _echoHandler; 123 _requestHandlers["/echo"] = _echoHandler;
124 } 124 }
125 125
126 void dispatch(message, SendPort replyTo) { 126 void dispatch(message, SendPort replyTo) {
127 if (message.isStart) { 127 if (message.isStart) {
128 try { 128 try {
129 HttpServer.bind().then((server) { 129 HttpServer.bind("127.0.0.1", 0).then((server) {
130 _server = server; 130 _server = server;
131 _server.listen(_requestReceivedHandler); 131 _server.listen(_requestReceivedHandler);
132 replyTo.send( 132 replyTo.send(
133 new IsolatedHttpServerStatus.started(_server.port), null); 133 new IsolatedHttpServerStatus.started(_server.port), null);
134 }); 134 });
135 } catch (e) { 135 } catch (e) {
136 replyTo.send(new IsolatedHttpServerStatus.error(), null); 136 replyTo.send(new IsolatedHttpServerStatus.error(), null);
137 } 137 }
138 } else if (message.isStop) { 138 } else if (message.isStop) {
139 _server.close(); 139 _server.close();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (chunkedEncoding) { 203 if (chunkedEncoding) {
204 server.chunkedEncoding(); 204 server.chunkedEncoding();
205 } 205 }
206 server.start(); 206 server.start();
207 } 207 }
208 208
209 void main() { 209 void main() {
210 testRead(true); 210 testRead(true);
211 testRead(false); 211 testRead(false);
212 } 212 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698