OLD | NEW |
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 import "dart:async"; | 5 import "dart:async"; |
6 import "dart:io"; | 6 import "dart:io"; |
7 import "dart:typed_data"; | 7 import "dart:typed_data"; |
8 | 8 |
9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
10 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 request.add([0]); | 101 request.add([0]); |
102 request.close(); | 102 request.close(); |
103 request.done.catchError((error) { | 103 request.done.catchError((error) { |
104 asyncEnd(); | 104 asyncEnd(); |
105 }, test: (e) => e is HttpException); | 105 }, test: (e) => e is HttpException); |
106 return request.done; | 106 return request.done; |
107 }); | 107 }); |
108 } | 108 } |
109 | 109 |
110 | 110 |
111 void testBadHeaders() { | |
112 asyncStart(); | |
113 testClientRequest((request) { | |
114 var value = "a"; | |
115 for (int i = 0; i < 8 * 1024; i++) { | |
116 value += 'a'; | |
117 } | |
118 request.headers.set('name', value); | |
119 request.done.catchError((error) { | |
120 asyncEnd(); | |
121 }, test: (e) => e is HttpException); | |
122 return request.close(); | |
123 }); | |
124 } | |
125 | |
126 | |
127 void main() { | 111 void main() { |
128 testResponseDone(); | 112 testResponseDone(); |
129 testBadResponseAdd(); | 113 testBadResponseAdd(); |
130 testBadResponseClose(); | 114 testBadResponseClose(); |
131 testBadHeaders(); | |
132 } | 115 } |
OLD | NEW |