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

Side by Side Diff: net/spdy/spdy_session_unittest.cc

Issue 9391027: Disable CREDENTIALS frames when using spdy/2.1 or earlier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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/spdy/spdy_session.cc ('k') | no next file » | 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/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include "net/base/ip_endpoint.h" 7 #include "net/base/ip_endpoint.h"
8 #include "net/spdy/spdy_io_buffer.h" 8 #include "net/spdy/spdy_io_buffer.h"
9 #include "net/spdy/spdy_session_pool.h" 9 #include "net/spdy/spdy_session_pool.h"
10 #include "net/spdy/spdy_stream.h" 10 #include "net/spdy/spdy_stream.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 MockConnect connect_data(false, OK); 913 MockConnect connect_data(false, OK);
914 MockRead reads[] = { 914 MockRead reads[] = {
915 MockRead(false, ERR_IO_PENDING) // Stall forever. 915 MockRead(false, ERR_IO_PENDING) // Stall forever.
916 }; 916 };
917 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); 917 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0);
918 data.set_connect_data(connect_data); 918 data.set_connect_data(connect_data);
919 session_deps.socket_factory->AddSocketDataProvider(&data); 919 session_deps.socket_factory->AddSocketDataProvider(&data);
920 920
921 SSLSocketDataProvider ssl(false, OK); 921 SSLSocketDataProvider ssl(false, OK);
922 ssl.origin_bound_cert_type = CLIENT_CERT_RSA_SIGN; 922 ssl.origin_bound_cert_type = CLIENT_CERT_RSA_SIGN;
923 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3;
923 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 924 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
924 925
925 scoped_refptr<HttpNetworkSession> http_session( 926 scoped_refptr<HttpNetworkSession> http_session(
926 SpdySessionDependencies::SpdyCreateSession(&session_deps)); 927 SpdySessionDependencies::SpdyCreateSession(&session_deps));
927 928
928 const std::string kTestHost("www.foo.com"); 929 const std::string kTestHost("www.foo.com");
929 const int kTestPort = 80; 930 const int kTestPort = 80;
930 HostPortPair test_host_port_pair(kTestHost, kTestPort); 931 HostPortPair test_host_port_pair(kTestHost, kTestPort);
931 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); 932 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
932 933
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 MockWrite writes[] = { 988 MockWrite writes[] = {
988 CreateMockWrite(*settings_frame), 989 CreateMockWrite(*settings_frame),
989 }; 990 };
990 StaticSocketDataProvider data(reads, arraysize(reads), 991 StaticSocketDataProvider data(reads, arraysize(reads),
991 writes, arraysize(writes)); 992 writes, arraysize(writes));
992 data.set_connect_data(connect_data); 993 data.set_connect_data(connect_data);
993 session_deps.socket_factory->AddSocketDataProvider(&data); 994 session_deps.socket_factory->AddSocketDataProvider(&data);
994 995
995 SSLSocketDataProvider ssl(false, OK); 996 SSLSocketDataProvider ssl(false, OK);
996 ssl.origin_bound_cert_type = CLIENT_CERT_RSA_SIGN; 997 ssl.origin_bound_cert_type = CLIENT_CERT_RSA_SIGN;
998 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY3;
997 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 999 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
998 1000
999 scoped_refptr<HttpNetworkSession> http_session( 1001 scoped_refptr<HttpNetworkSession> http_session(
1000 SpdySessionDependencies::SpdyCreateSession(&session_deps)); 1002 SpdySessionDependencies::SpdyCreateSession(&session_deps));
1001 1003
1002 const std::string kTestHost("www.foo.com"); 1004 const std::string kTestHost("www.foo.com");
1003 const int kTestPort = 80; 1005 const int kTestPort = 80;
1004 HostPortPair test_host_port_pair(kTestHost, kTestPort); 1006 HostPortPair test_host_port_pair(kTestHost, kTestPort);
1005 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); 1007 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
1006 1008
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 EXPECT_TRUE(session->NeedsCredentials(test_host_port_pair2)); 1044 EXPECT_TRUE(session->NeedsCredentials(test_host_port_pair2));
1043 1045
1044 // Flush the SpdySession::OnReadComplete() task. 1046 // Flush the SpdySession::OnReadComplete() task.
1045 MessageLoop::current()->RunAllPending(); 1047 MessageLoop::current()->RunAllPending();
1046 1048
1047 spdy_session_pool->Remove(session); 1049 spdy_session_pool->Remove(session);
1048 EXPECT_FALSE(spdy_session_pool->HasSession(pair)); 1050 EXPECT_FALSE(spdy_session_pool->HasSession(pair));
1049 } 1051 }
1050 1052
1051 } // namespace net 1053 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698