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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 344253008: Stop using SpdySynReplyIR for SPDY 4. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional test fix & SpdyTestUtil cleanup. Created 6 years, 6 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 | « no previous file | net/http/http_proxy_client_socket_pool_unittest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 6370 matching lines...) Expand 10 before | Expand all | Expand 10 after
6381 6381
6382 MockWrite spdy_writes[] = { 6382 MockWrite spdy_writes[] = {
6383 CreateMockWrite(*req, 1, ASYNC), 6383 CreateMockWrite(*req, 1, ASYNC),
6384 CreateMockWrite(*rst, 4, ASYNC), 6384 CreateMockWrite(*rst, 4, ASYNC),
6385 CreateMockWrite(*connect2, 5), 6385 CreateMockWrite(*connect2, 5),
6386 CreateMockWrite(*wrapped_get, 8), 6386 CreateMockWrite(*wrapped_get, 8),
6387 }; 6387 };
6388 6388
6389 // The proxy responds to the connect with a 407, using a persistent 6389 // The proxy responds to the connect with a 407, using a persistent
6390 // connection. 6390 // connection.
6391 const char* const kAuthStatus = "407";
6391 const char* const kAuthChallenge[] = { 6392 const char* const kAuthChallenge[] = {
6392 spdy_util_.GetStatusKey(), "407 Proxy Authentication Required",
6393 spdy_util_.GetVersionKey(), "HTTP/1.1",
6394 "proxy-authenticate", "Basic realm=\"MyRealm1\"", 6393 "proxy-authenticate", "Basic realm=\"MyRealm1\"",
6395 }; 6394 };
6396 6395 scoped_ptr<SpdyFrame> conn_auth_resp(spdy_util_.ConstructSpdySynReplyError(
6397 scoped_ptr<SpdyFrame> conn_auth_resp( 6396 kAuthStatus, kAuthChallenge, arraysize(kAuthChallenge) / 2, 1));
6398 spdy_util_.ConstructSpdyControlFrame(NULL,
6399 0,
6400 false,
6401 1,
6402 LOWEST,
6403 SYN_REPLY,
6404 CONTROL_FLAG_NONE,
6405 kAuthChallenge,
6406 arraysize(kAuthChallenge),
6407 0));
6408 6397
6409 scoped_ptr<SpdyFrame> conn_resp( 6398 scoped_ptr<SpdyFrame> conn_resp(
6410 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3)); 6399 spdy_util_.ConstructSpdyGetSynReply(NULL, 0, 3));
6411 const char resp[] = "HTTP/1.1 200 OK\r\n" 6400 const char resp[] = "HTTP/1.1 200 OK\r\n"
6412 "Content-Length: 5\r\n\r\n"; 6401 "Content-Length: 5\r\n\r\n";
6413 6402
6414 scoped_ptr<SpdyFrame> wrapped_get_resp( 6403 scoped_ptr<SpdyFrame> wrapped_get_resp(
6415 spdy_util_.ConstructSpdyBodyFrame(3, resp, strlen(resp), false)); 6404 spdy_util_.ConstructSpdyBodyFrame(3, resp, strlen(resp), false));
6416 scoped_ptr<SpdyFrame> wrapped_body( 6405 scoped_ptr<SpdyFrame> wrapped_body(
6417 spdy_util_.ConstructSpdyBodyFrame(3, "hello", 5, false)); 6406 spdy_util_.ConstructSpdyBodyFrame(3, "hello", 5, false));
(...skipping 6763 matching lines...) Expand 10 before | Expand all | Expand 10 after
13181 EXPECT_EQ(ERR_IO_PENDING, rv); 13170 EXPECT_EQ(ERR_IO_PENDING, rv);
13182 13171
13183 rv = callback.WaitForResult(); 13172 rv = callback.WaitForResult();
13184 EXPECT_EQ(ERR_CONNECTION_RESET, rv); 13173 EXPECT_EQ(ERR_CONNECTION_RESET, rv);
13185 13174
13186 const HttpResponseInfo* response = trans->GetResponseInfo(); 13175 const HttpResponseInfo* response = trans->GetResponseInfo();
13187 EXPECT_TRUE(response == NULL); 13176 EXPECT_TRUE(response == NULL);
13188 } 13177 }
13189 13178
13190 } // namespace net 13179 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_proxy_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698