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

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

Issue 308923002: When a connection is upgraded, don't return it as idle. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 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_detach_socket_test.dart
diff --git a/tests/standalone/io/http_detach_socket_test.dart b/tests/standalone/io/http_detach_socket_test.dart
index e5669d659b0bafb0b1e4956d517a81a2764c2eed..53c8fc4f2c7bbbc0a336c1a88007e9bf4f3024ea 100644
--- a/tests/standalone/io/http_detach_socket_test.dart
+++ b/tests/standalone/io/http_detach_socket_test.dart
@@ -145,9 +145,42 @@ void testClientDetachSocket() {
});
}
+void testUpgradedConnection() {
+ HttpServer.bind("127.0.0.1", 0).then((server) {
+ server.listen((request) {
+ request.response.headers.set('connection', 'upgrade');
Søren Gjesse 2014/06/02 07:30:52 Should this test also detach the socket on this si
Anders Johnsen 2014/06/02 08:00:35 Done.
+ request.response.close();
+ });
+
+ var client = new HttpClient();
+ client.userAgent = null;
+ client.get("127.0.0.1", server.port, "/")
+ .then((request) {
+ request.headers.set('upgrade', 'mine');
+ return request.close();
+ })
+ .then((response) {
+ client.get("127.0.0.1", server.port, "/")
+ .then((request) {
+ response.detachSocket().then((socket) {
+ // We are testing that we can detach the socket, even though
+ // we made a new connection (testing it was not reused).
+ request.close().then((response) {
+ response.drain().then((_) {
+ server.close();
+ });
+ socket.destroy();
+ });
+ });
+ });
+ });
+ });
+}
+
void main() {
testServerDetachSocket();
testServerDetachSocketNoWriteHeaders();
testBadServerDetachSocket();
testClientDetachSocket();
+ testUpgradedConnection();
}
« 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