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

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

Issue 9959033: Move NextProto enum to a new file net/socket/next_proto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address wtc's comments Created 8 years, 8 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') | net/spdy/spdy_session_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/spdy/spdy_session.h" 5 #include "net/spdy/spdy_session.h"
6 6
7 #include "net/base/host_cache.h" 7 #include "net/base/host_cache.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_log_unittest.h" 9 #include "net/base/net_log_unittest.h"
10 #include "net/spdy/spdy_io_buffer.h" 10 #include "net/spdy/spdy_io_buffer.h"
11 #include "net/spdy/spdy_session_pool.h" 11 #include "net/spdy/spdy_session_pool.h"
12 #include "net/spdy/spdy_stream.h" 12 #include "net/spdy/spdy_stream.h"
13 #include "net/spdy/spdy_test_util_spdy2.h" 13 #include "net/spdy/spdy_test_util_spdy2.h"
14 #include "testing/platform_test.h" 14 #include "testing/platform_test.h"
15 15
16 using namespace net::test_spdy2; 16 using namespace net::test_spdy2;
17 17
18 namespace net { 18 namespace net {
19 19
20 // TODO(cbentzel): Expose compression setter/getter in public SpdySession 20 // TODO(cbentzel): Expose compression setter/getter in public SpdySession
21 // interface rather than going through all these contortions. 21 // interface rather than going through all these contortions.
22 class SpdySessionSpdy2Test : public PlatformTest { 22 class SpdySessionSpdy2Test : public PlatformTest {
23 protected: 23 protected:
24 virtual void SetUp() { 24 virtual void SetUp() {
25 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); 25 SpdySession::set_default_protocol(kProtoSPDY2);
26 } 26 }
27 27
28 private: 28 private:
29 SpdyTestStateHelper spdy_state_; 29 SpdyTestStateHelper spdy_state_;
30 }; 30 };
31 31
32 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate { 32 class TestSpdyStreamDelegate : public net::SpdyStream::Delegate {
33 public: 33 public:
34 explicit TestSpdyStreamDelegate(const CompletionCallback& callback) 34 explicit TestSpdyStreamDelegate(const CompletionCallback& callback)
35 : callback_(callback) {} 35 : callback_(callback) {}
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway()); 114 scoped_ptr<SpdyFrame> goaway(ConstructSpdyGoAway());
115 MockRead reads[] = { 115 MockRead reads[] = {
116 CreateMockRead(*goaway), 116 CreateMockRead(*goaway),
117 MockRead(SYNCHRONOUS, 0, 0) // EOF 117 MockRead(SYNCHRONOUS, 0, 0) // EOF
118 }; 118 };
119 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); 119 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0);
120 data.set_connect_data(connect_data); 120 data.set_connect_data(connect_data);
121 session_deps.socket_factory->AddSocketDataProvider(&data); 121 session_deps.socket_factory->AddSocketDataProvider(&data);
122 122
123 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); 123 SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
124 ssl.SetNextProto(SSLClientSocket::kProtoSPDY2); 124 ssl.SetNextProto(kProtoSPDY2);
125 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 125 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
126 126
127 scoped_refptr<HttpNetworkSession> http_session( 127 scoped_refptr<HttpNetworkSession> http_session(
128 SpdySessionDependencies::SpdyCreateSession(&session_deps)); 128 SpdySessionDependencies::SpdyCreateSession(&session_deps));
129 129
130 const std::string kTestHost("www.foo.com"); 130 const std::string kTestHost("www.foo.com");
131 const int kTestPort = 80; 131 const int kTestPort = 80;
132 HostPortPair test_host_port_pair(kTestHost, kTestPort); 132 HostPortPair test_host_port_pair(kTestHost, kTestPort);
133 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); 133 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
134 134
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 MockConnect connect_data(SYNCHRONOUS, OK); 934 MockConnect connect_data(SYNCHRONOUS, OK);
935 MockRead reads[] = { 935 MockRead reads[] = {
936 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. 936 MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever.
937 }; 937 };
938 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0); 938 StaticSocketDataProvider data(reads, arraysize(reads), NULL, 0);
939 data.set_connect_data(connect_data); 939 data.set_connect_data(connect_data);
940 session_deps.socket_factory->AddSocketDataProvider(&data); 940 session_deps.socket_factory->AddSocketDataProvider(&data);
941 941
942 SSLSocketDataProvider ssl(SYNCHRONOUS, OK); 942 SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
943 ssl.domain_bound_cert_type = CLIENT_CERT_ECDSA_SIGN; 943 ssl.domain_bound_cert_type = CLIENT_CERT_ECDSA_SIGN;
944 ssl.protocol_negotiated = SSLClientSocket::kProtoSPDY2; 944 ssl.protocol_negotiated = kProtoSPDY2;
945 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); 945 session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
946 946
947 scoped_refptr<HttpNetworkSession> http_session( 947 scoped_refptr<HttpNetworkSession> http_session(
948 SpdySessionDependencies::SpdyCreateSession(&session_deps)); 948 SpdySessionDependencies::SpdyCreateSession(&session_deps));
949 949
950 const std::string kTestHost("www.foo.com"); 950 const std::string kTestHost("www.foo.com");
951 const int kTestPort = 80; 951 const int kTestPort = 80;
952 HostPortPair test_host_port_pair(kTestHost, kTestPort); 952 HostPortPair test_host_port_pair(kTestHost, kTestPort);
953 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct()); 953 HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
954 954
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 net::NetLog::PHASE_NONE); 1058 net::NetLog::PHASE_NONE);
1059 1059
1060 CapturingNetLog::Entry entry = entries[pos]; 1060 CapturingNetLog::Entry entry = entries[pos];
1061 NetLogSpdySessionCloseParameter* request_params = 1061 NetLogSpdySessionCloseParameter* request_params =
1062 static_cast<NetLogSpdySessionCloseParameter*>( 1062 static_cast<NetLogSpdySessionCloseParameter*>(
1063 entry.extra_parameters.get()); 1063 entry.extra_parameters.get());
1064 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status()); 1064 EXPECT_EQ(ERR_CONNECTION_CLOSED, request_params->status());
1065 } 1065 }
1066 1066
1067 } // namespace net 1067 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698