| OLD | NEW |
| 1 import 'dart:async'; | 1 import 'dart:async'; |
| 2 import 'dart:io'; | 2 import 'dart:io'; |
| 3 import 'dart:isolate'; | 3 import 'dart:isolate'; |
| 4 | 4 |
| 5 void sendData(List<int> data, int port) { | 5 void sendData(List<int> data, int port) { |
| 6 Socket socket = new Socket("127.0.0.1", port); | 6 Socket socket = new Socket("127.0.0.1", port); |
| 7 socket.onConnect = () { | 7 socket.onConnect = () { |
| 8 socket.onData = () { | 8 socket.onData = () { |
| 9 Expect.fail("No data response was expected"); | 9 Expect.fail("No data response was expected"); |
| 10 }; | 10 }; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 "Connection closed before full body was received", | 74 "Connection closed before full body was received", |
| 75 expectRequest: true); | 75 expectRequest: true); |
| 76 add("GET / HTTP/1.1\r\nContent-Length: 100\r\n\r\n1", | 76 add("GET / HTTP/1.1\r\nContent-Length: 100\r\n\r\n1", |
| 77 "Connection closed before full body was received", | 77 "Connection closed before full body was received", |
| 78 expectRequest: true); | 78 expectRequest: true); |
| 79 | 79 |
| 80 | 80 |
| 81 HttpServer server = new HttpServer(); | 81 HttpServer server = new HttpServer(); |
| 82 server.listen("127.0.0.1", 0); | 82 server.listen("127.0.0.1", 0); |
| 83 void runTest(Iterator it) { | 83 void runTest(Iterator it) { |
| 84 if (it.hasNext) { | 84 if (it.moveNext()) { |
| 85 it.next().execute(server).then((_) => runTest(it)); | 85 it.current.execute(server).then((_) => runTest(it)); |
| 86 } else { | 86 } else { |
| 87 server.close(); | 87 server.close(); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 runTest(tests.iterator()); | 90 runTest(tests.iterator); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void main() { | 93 void main() { |
| 94 testEarlyClose(); | 94 testEarlyClose(); |
| 95 } | 95 } |
| OLD | NEW |