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

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

Issue 10795012: Modify DeterministicSocketData to verify that the sequence number of reads and writes start at zero… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sleevi's comments Created 8 years, 5 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 EXPECT_EQ(OK, rv); 337 EXPECT_EQ(OK, rv);
338 EXPECT_TRUE(handle_.is_initialized()); 338 EXPECT_TRUE(handle_.is_initialized());
339 ASSERT_TRUE(handle_.socket()); 339 ASSERT_TRUE(handle_.socket());
340 HttpProxyClientSocket* tunnel_socket = 340 HttpProxyClientSocket* tunnel_socket =
341 static_cast<HttpProxyClientSocket*>(handle_.socket()); 341 static_cast<HttpProxyClientSocket*>(handle_.socket());
342 EXPECT_TRUE(tunnel_socket->IsConnected()); 342 EXPECT_TRUE(tunnel_socket->IsConnected());
343 } 343 }
344 344
345 TEST_P(HttpProxyClientSocketPoolSpdy2Test, AsyncHaveAuth) { 345 TEST_P(HttpProxyClientSocketPoolSpdy2Test, AsyncHaveAuth) {
346 MockWrite writes[] = { 346 MockWrite writes[] = {
347 MockWrite("CONNECT www.google.com:443 HTTP/1.1\r\n" 347 MockWrite(ASYNC, 0, "CONNECT www.google.com:443 HTTP/1.1\r\n"
348 "Host: www.google.com\r\n" 348 "Host: www.google.com\r\n"
349 "Proxy-Connection: keep-alive\r\n" 349 "Proxy-Connection: keep-alive\r\n"
350 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), 350 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"),
351 }; 351 };
352 MockRead reads[] = { 352 MockRead reads[] = {
353 MockRead(SYNCHRONOUS, "HTTP/1.1 200 Connection Established\r\n\r\n"), 353 MockRead(ASYNC, 1, "HTTP/1.1 200 Connection Established\r\n\r\n"),
354 }; 354 };
355 355
356 scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, 356 scoped_ptr<SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders,
357 kAuthHeadersSize, 1)); 357 kAuthHeadersSize, 1));
358 MockWrite spdy_writes[] = { 358 MockWrite spdy_writes[] = {
359 CreateMockWrite(*req, 0, ASYNC) 359 CreateMockWrite(*req, 0, ASYNC)
360 }; 360 };
361 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); 361 scoped_ptr<SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1));
362 MockRead spdy_reads[] = { 362 MockRead spdy_reads[] = {
363 CreateMockRead(*resp, 1, ASYNC), 363 CreateMockRead(*resp, 1, ASYNC),
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // HTTPS or SPDY Proxy CONNECT responses are trustworthy 538 // HTTPS or SPDY Proxy CONNECT responses are trustworthy
539 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv); 539 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv);
540 EXPECT_TRUE(handle_.is_initialized()); 540 EXPECT_TRUE(handle_.is_initialized());
541 EXPECT_TRUE(handle_.socket()); 541 EXPECT_TRUE(handle_.socket());
542 } 542 }
543 } 543 }
544 544
545 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 545 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
546 546
547 } // namespace net 547 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_proxy_client_socket_pool_spdy3_unittest.cc » ('j') | net/socket/socket_test_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698