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

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

Issue 16776005: net: use IsSecureScheme rather than matching "https". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ERR_HEADERS_TRUNCATED => ERR_RESPONSE_HEADERS_TRUNCATED Created 7 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 | « net/base/net_error_list.h ('k') | net/http/http_proxy_client_socket_pool_spdy3_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 (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/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 EXPECT_EQ(ERR_IO_PENDING, rv); 476 EXPECT_EQ(ERR_IO_PENDING, rv);
477 EXPECT_FALSE(handle_.is_initialized()); 477 EXPECT_FALSE(handle_.is_initialized());
478 EXPECT_FALSE(handle_.socket()); 478 EXPECT_FALSE(handle_.socket());
479 479
480 data_->RunFor(3); 480 data_->RunFor(3);
481 if (GetParam() == SPDY) { 481 if (GetParam() == SPDY) {
482 // SPDY cannot process a headers block unless it's complete and so it 482 // SPDY cannot process a headers block unless it's complete and so it
483 // returns ERR_CONNECTION_CLOSED in this case. 483 // returns ERR_CONNECTION_CLOSED in this case.
484 EXPECT_EQ(ERR_CONNECTION_CLOSED, callback_.WaitForResult()); 484 EXPECT_EQ(ERR_CONNECTION_CLOSED, callback_.WaitForResult());
485 } else { 485 } else {
486 EXPECT_EQ(ERR_HEADERS_TRUNCATED, callback_.WaitForResult()); 486 EXPECT_EQ(ERR_RESPONSE_HEADERS_TRUNCATED, callback_.WaitForResult());
487 } 487 }
488 EXPECT_FALSE(handle_.is_initialized()); 488 EXPECT_FALSE(handle_.is_initialized());
489 EXPECT_FALSE(handle_.socket()); 489 EXPECT_FALSE(handle_.socket());
490 } 490 }
491 491
492 TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupError) { 492 TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupError) {
493 MockWrite writes[] = { 493 MockWrite writes[] = {
494 MockWrite(ASYNC, 0, 494 MockWrite(ASYNC, 0,
495 "CONNECT www.google.com:443 HTTP/1.1\r\n" 495 "CONNECT www.google.com:443 HTTP/1.1\r\n"
496 "Host: www.google.com\r\n" 496 "Host: www.google.com\r\n"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 // Make sure Location header was included and correct. 614 // Make sure Location header was included and correct.
615 std::string location; 615 std::string location;
616 EXPECT_TRUE(headers->IsRedirect(&location)); 616 EXPECT_TRUE(headers->IsRedirect(&location));
617 EXPECT_EQ(location, redirectTarget); 617 EXPECT_EQ(location, redirectTarget);
618 } 618 }
619 } 619 }
620 620
621 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 621 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
622 622
623 } // namespace net 623 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_error_list.h ('k') | net/http/http_proxy_client_socket_pool_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698