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

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

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 #import("dart:io"); 1 #import("dart:io");
2 #import("dart:isolate"); 2 #import("dart:isolate");
3 3
4 void sendData(List<int> data, int port) { 4 void sendData(List<int> data, int port) {
5 Socket socket = new Socket("127.0.0.1", port); 5 Socket socket = new Socket("127.0.0.1", port);
6 socket.onConnect = () { 6 socket.onConnect = () {
7 socket.onData = () { 7 socket.onData = () {
8 Expect.fail("No data response was expected"); 8 Expect.fail("No data response was expected");
9 }; 9 };
10 socket.outputStream.onNoPendingWrites = () { 10 socket.outputStream.onNoPendingWrites = () {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 return c.future; 50 return c.future;
51 } 51 }
52 52
53 final data; 53 final data;
54 final String exception; 54 final String exception;
55 final bool expectRequest; 55 final bool expectRequest;
56 } 56 }
57 57
58 void testEarlyClose() { 58 void testEarlyClose() {
59 List<EarlyCloseTest> tests = new List<EarlyCloseTest>(); 59 List<EarlyCloseTest> tests = new List<EarlyCloseTest>();
60 void add(Object data, String exception, [bool expectRequest = false]) { 60 void add(Object data, String exception, {bool expectRequest: false}) {
61 tests.add(new EarlyCloseTest(data, exception, expectRequest)); 61 tests.add(new EarlyCloseTest(data, exception, expectRequest));
62 } 62 }
63 // The empty packet is valid. 63 // The empty packet is valid.
64 64
65 // Close while sending header 65 // Close while sending header
66 add("G", "Connection closed before full header was received"); 66 add("G", "Connection closed before full header was received");
67 add("GET /", "Connection closed before full header was received"); 67 add("GET /", "Connection closed before full header was received");
68 add("GET / HTTP/1.1", "Connection closed before full header was received"); 68 add("GET / HTTP/1.1", "Connection closed before full header was received");
69 add("GET / HTTP/1.1\r\n", "Connection closed before full header was received") ; 69 add("GET / HTTP/1.1\r\n", "Connection closed before full header was received") ;
70 70
(...skipping 14 matching lines...) Expand all
85 } else { 85 } else {
86 server.close(); 86 server.close();
87 } 87 }
88 } 88 }
89 runTest(tests.iterator()); 89 runTest(tests.iterator());
90 } 90 }
91 91
92 void main() { 92 void main() {
93 testEarlyClose(); 93 testEarlyClose();
94 } 94 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698