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

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

Issue 4935001: Allow a non-200 (or non-407) response for a CONNECT request from an HTTPS pro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 AddAuthToCache(); 491 AddAuthToCache();
492 492
493 int rv = handle_.Init("a", GetTunnelParams(), LOW, &callback_, &pool_, 493 int rv = handle_.Init("a", GetTunnelParams(), LOW, &callback_, &pool_,
494 BoundNetLog()); 494 BoundNetLog());
495 EXPECT_EQ(ERR_IO_PENDING, rv); 495 EXPECT_EQ(ERR_IO_PENDING, rv);
496 EXPECT_FALSE(handle_.is_initialized()); 496 EXPECT_FALSE(handle_.is_initialized());
497 EXPECT_FALSE(handle_.socket()); 497 EXPECT_FALSE(handle_.socket());
498 498
499 data_->RunFor(2); 499 data_->RunFor(2);
500 500
501 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, callback_.WaitForResult()); 501 rv = callback_.WaitForResult();
502 EXPECT_FALSE(handle_.is_initialized()); 502 if (GetParam() == HTTP) {
503 EXPECT_FALSE(handle_.socket()); 503 // HTTP Proxy CONNECT responses are not trustworthy
504 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv);
505 EXPECT_FALSE(handle_.is_initialized());
506 EXPECT_FALSE(handle_.socket());
507 } else {
508 // HTTPS or SPDY Proxy CONNECT responses are trustworthy
509 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv);
510 EXPECT_TRUE(handle_.is_initialized());
511 EXPECT_TRUE(handle_.socket());
512 }
504 } 513 }
505 514
506 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 515 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
507 516
508 } // namespace net 517 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698