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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk 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
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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 EXPECT_FALSE(handle_.socket()); 597 EXPECT_FALSE(handle_.socket());
598 } else { 598 } else {
599 // Expect ProxyClientSocket to return the proxy's response, sanitized. 599 // Expect ProxyClientSocket to return the proxy's response, sanitized.
600 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv); 600 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv);
601 EXPECT_TRUE(handle_.is_initialized()); 601 EXPECT_TRUE(handle_.is_initialized());
602 ASSERT_TRUE(handle_.socket()); 602 ASSERT_TRUE(handle_.socket());
603 603
604 const ProxyClientSocket* tunnel_socket = 604 const ProxyClientSocket* tunnel_socket =
605 static_cast<ProxyClientSocket*>(handle_.socket()); 605 static_cast<ProxyClientSocket*>(handle_.socket());
606 const HttpResponseInfo* response = tunnel_socket->GetConnectResponseInfo(); 606 const HttpResponseInfo* response = tunnel_socket->GetConnectResponseInfo();
607 const HttpResponseHeaders* headers = response->headers; 607 const HttpResponseHeaders* headers = response->headers.get();
608 608
609 // Make sure Set-Cookie header was stripped. 609 // Make sure Set-Cookie header was stripped.
610 EXPECT_FALSE(headers->HasHeader("set-cookie")); 610 EXPECT_FALSE(headers->HasHeader("set-cookie"));
611 611
612 // Make sure Content-Length: 0 header was added. 612 // Make sure Content-Length: 0 header was added.
613 EXPECT_TRUE(headers->HasHeaderValue("content-length", "0")); 613 EXPECT_TRUE(headers->HasHeaderValue("content-length", "0"));
614 614
615 // Make sure Location header was included and correct. 615 // Make sure Location header was included and correct.
616 std::string location; 616 std::string location;
617 EXPECT_TRUE(headers->IsRedirect(&location)); 617 EXPECT_TRUE(headers->IsRedirect(&location));
618 EXPECT_EQ(location, redirectTarget); 618 EXPECT_EQ(location, redirectTarget);
619 } 619 }
620 } 620 }
621 621
622 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. 622 // It would be nice to also test the timeouts in HttpProxyClientSocketPool.
623 623
624 } // namespace net 624 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool_spdy2_unittest.cc ('k') | net/http/http_response_body_drainer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698