[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/basictypes.h" |
| 6 | #include "base/compiler_specific.h" |
| 7 | #include "base/memory/scoped_ptr.h" |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 8 | #include "base/stl_util.h" |
| 9 | #include "net/base/capturing_net_log.h" |
| 10 | #include "net/base/net_log_unittest.h" |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 11 | #include "net/base/test_completion_callback.h" |
[email protected] | 6e7845ae | 2013-03-29 21:48:11 | [diff] [blame] | 12 | #include "net/cert/mock_cert_verifier.h" |
[email protected] | f2cb3cf | 2013-03-21 01:40:53 | [diff] [blame] | 13 | #include "net/dns/mock_host_resolver.h" |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 14 | #include "net/http/http_auth_handler_factory.h" |
| 15 | #include "net/http/http_network_session.h" |
| 16 | #include "net/http/http_network_transaction.h" |
| 17 | #include "net/http/http_server_properties_impl.h" |
| 18 | #include "net/http/http_stream.h" |
| 19 | #include "net/http/http_stream_factory.h" |
| 20 | #include "net/http/http_transaction_unittest.h" |
| 21 | #include "net/proxy/proxy_config_service_fixed.h" |
| 22 | #include "net/proxy/proxy_resolver.h" |
| 23 | #include "net/proxy/proxy_service.h" |
| 24 | #include "net/quic/crypto/quic_decrypter.h" |
| 25 | #include "net/quic/crypto/quic_encrypter.h" |
| 26 | #include "net/quic/quic_framer.h" |
[email protected] | ed3fc15d | 2013-03-08 18:37:44 | [diff] [blame] | 27 | #include "net/quic/test_tools/crypto_test_utils.h" |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 28 | #include "net/quic/test_tools/mock_clock.h" |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 29 | #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 30 | #include "net/quic/test_tools/mock_random.h" |
| 31 | #include "net/quic/test_tools/quic_test_utils.h" |
| 32 | #include "net/socket/client_socket_factory.h" |
| 33 | #include "net/socket/mock_client_socket_pool_manager.h" |
| 34 | #include "net/socket/socket_test_util.h" |
| 35 | #include "net/socket/ssl_client_socket.h" |
| 36 | #include "net/spdy/spdy_frame_builder.h" |
| 37 | #include "net/spdy/spdy_framer.h" |
[email protected] | 536fd0b | 2013-03-14 17:41:57 | [diff] [blame] | 38 | #include "net/ssl/ssl_config_service_defaults.h" |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 39 | #include "testing/gtest/include/gtest/gtest.h" |
| 40 | #include "testing/platform_test.h" |
| 41 | |
| 42 | //----------------------------------------------------------------------------- |
| 43 | |
| 44 | namespace { |
| 45 | |
| 46 | // This is the expected return from a current server advertising QUIC. |
| 47 | static const char kQuicAlternateProtocolHttpHeader[] = |
[email protected] | 7db54b8 | 2013-04-01 21:53:45 | [diff] [blame] | 48 | "Alternate-Protocol: 443:quic\r\n\r\n"; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 49 | |
| 50 | // Returns a vector of NPN protocol strings for negotiating QUIC. |
| 51 | std::vector<std::string> QuicNextProtos() { |
| 52 | std::vector<std::string> protos; |
| 53 | protos.push_back("http/1.1"); |
[email protected] | 7db54b8 | 2013-04-01 21:53:45 | [diff] [blame] | 54 | protos.push_back("quic"); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 55 | return protos; |
| 56 | } |
| 57 | |
| 58 | } // namespace |
| 59 | |
| 60 | namespace net { |
| 61 | namespace test { |
| 62 | |
| 63 | class QuicNetworkTransactionTest : public PlatformTest { |
| 64 | protected: |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 65 | QuicNetworkTransactionTest() |
| 66 | : clock_(new MockClock), |
| 67 | ssl_config_service_(new SSLConfigServiceDefaults), |
| 68 | proxy_service_(ProxyService::CreateDirect()), |
[email protected] | c244c5a1 | 2013-05-07 20:55:04 | [diff] [blame] | 69 | compressor_(new QuicSpdyCompressor()), |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 70 | auth_handler_factory_( |
| 71 | HttpAuthHandlerFactory::CreateDefault(&host_resolver_)) { |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 72 | request_.method = "GET"; |
| 73 | request_.url = GURL("http://www.google.com/"); |
| 74 | request_.load_flags = 0; |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 75 | } |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 76 | |
| 77 | virtual void SetUp() { |
| 78 | NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); |
[email protected] | 2da659e | 2013-05-23 20:51:34 | [diff] [blame] | 79 | base::MessageLoop::current()->RunUntilIdle(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | virtual void TearDown() { |
| 83 | NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); |
| 84 | // Empty the current queue. |
[email protected] | 2da659e | 2013-05-23 20:51:34 | [diff] [blame] | 85 | base::MessageLoop::current()->RunUntilIdle(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 86 | PlatformTest::TearDown(); |
| 87 | NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); |
[email protected] | 2da659e | 2013-05-23 20:51:34 | [diff] [blame] | 88 | base::MessageLoop::current()->RunUntilIdle(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 89 | HttpStreamFactory::set_use_alternate_protocols(false); |
| 90 | HttpStreamFactory::SetNextProtos(std::vector<std::string>()); |
| 91 | } |
| 92 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 93 | scoped_ptr<QuicEncryptedPacket> ConstructRstPacket( |
| 94 | QuicPacketSequenceNumber num, |
| 95 | QuicStreamId stream_id) { |
| 96 | QuicPacketHeader header; |
| 97 | header.public_header.guid = 0xDEADBEEF; |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 98 | header.public_header.reset_flag = false; |
| 99 | header.public_header.version_flag = false; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 100 | header.packet_sequence_number = num; |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 101 | header.entropy_flag = false; |
| 102 | header.fec_flag = false; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 103 | header.fec_group = 0; |
| 104 | |
[email protected] | 74bda14 | 2013-03-31 02:49:11 | [diff] [blame] | 105 | QuicRstStreamFrame rst(stream_id, QUIC_STREAM_NO_ERROR); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 106 | return scoped_ptr<QuicEncryptedPacket>( |
| 107 | ConstructPacket(header, QuicFrame(&rst))); |
| 108 | } |
| 109 | |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 110 | scoped_ptr<QuicEncryptedPacket> ConstructConnectionClosePacket( |
| 111 | QuicPacketSequenceNumber num) { |
| 112 | QuicPacketHeader header; |
| 113 | header.public_header.guid = 0xDEADBEEF; |
| 114 | header.public_header.reset_flag = false; |
| 115 | header.public_header.version_flag = false; |
| 116 | header.packet_sequence_number = num; |
| 117 | header.entropy_flag = false; |
| 118 | header.fec_flag = false; |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 119 | header.fec_group = 0; |
| 120 | |
| 121 | QuicAckFrame ack_frame(0, QuicTime::Zero(), 0); |
| 122 | QuicConnectionCloseFrame close; |
| 123 | close.error_code = QUIC_CRYPTO_VERSION_NOT_SUPPORTED; |
| 124 | close.error_details = "Time to panic!"; |
| 125 | close.ack_frame = ack_frame; |
| 126 | return scoped_ptr<QuicEncryptedPacket>( |
| 127 | ConstructPacket(header, QuicFrame(&close))); |
| 128 | } |
| 129 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 130 | scoped_ptr<QuicEncryptedPacket> ConstructAckPacket( |
| 131 | QuicPacketSequenceNumber largest_received, |
| 132 | QuicPacketSequenceNumber least_unacked) { |
| 133 | QuicPacketHeader header; |
| 134 | header.public_header.guid = 0xDEADBEEF; |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 135 | header.public_header.reset_flag = false; |
| 136 | header.public_header.version_flag = false; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 137 | header.packet_sequence_number = 2; |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 138 | header.entropy_flag = false; |
| 139 | header.fec_flag = false; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 140 | header.fec_group = 0; |
| 141 | |
[email protected] | 14e8106c | 2013-03-14 16:25:33 | [diff] [blame] | 142 | QuicAckFrame ack(largest_received, QuicTime::Zero(), least_unacked); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 143 | |
| 144 | QuicCongestionFeedbackFrame feedback; |
| 145 | feedback.type = kTCP; |
| 146 | feedback.tcp.accumulated_number_of_lost_packets = 0; |
| 147 | feedback.tcp.receive_window = 256000; |
| 148 | |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 149 | QuicFramer framer(kQuicVersion1, QuicTime::Zero(), false); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 150 | QuicFrames frames; |
| 151 | frames.push_back(QuicFrame(&ack)); |
| 152 | frames.push_back(QuicFrame(&feedback)); |
| 153 | scoped_ptr<QuicPacket> packet( |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 154 | framer.ConstructFrameDataPacket(header, frames).packet); |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 155 | return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket( |
| 156 | ENCRYPTION_NONE, header.packet_sequence_number, *packet)); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | std::string GetRequestString(const std::string& method, |
| 160 | const std::string& path) { |
| 161 | SpdyHeaderBlock headers; |
| 162 | headers[":method"] = method; |
| 163 | headers[":host"] = "www.google.com"; |
| 164 | headers[":path"] = path; |
| 165 | headers[":scheme"] = "http"; |
| 166 | headers[":version"] = "HTTP/1.1"; |
| 167 | return SerializeHeaderBlock(headers); |
| 168 | } |
| 169 | |
| 170 | std::string GetResponseString(const std::string& status, |
| 171 | const std::string& body) { |
| 172 | SpdyHeaderBlock headers; |
| 173 | headers[":status"] = status; |
| 174 | headers[":version"] = "HTTP/1.1"; |
| 175 | headers["content-type"] = "text/plain"; |
[email protected] | c244c5a1 | 2013-05-07 20:55:04 | [diff] [blame] | 176 | return compressor_->CompressHeaders(headers) + body; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | std::string SerializeHeaderBlock(const SpdyHeaderBlock& headers) { |
[email protected] | 821555c | 2013-05-16 20:20:17 | [diff] [blame] | 180 | QuicSpdyCompressor compressor; |
| 181 | return compressor.CompressHeaders(headers); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | // Returns a newly created packet to send kData on stream 1. |
| 185 | QuicEncryptedPacket* ConstructDataPacket( |
| 186 | QuicPacketSequenceNumber sequence_number, |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 187 | QuicStreamId stream_id, |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 188 | bool should_include_version, |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 189 | bool fin, |
| 190 | QuicStreamOffset offset, |
| 191 | base::StringPiece data) { |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 192 | InitializeHeader(sequence_number, should_include_version); |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 193 | QuicStreamFrame frame(stream_id, fin, offset, data); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 194 | return ConstructPacket(header_, QuicFrame(&frame)).release(); |
| 195 | } |
| 196 | |
| 197 | scoped_ptr<QuicEncryptedPacket> ConstructPacket( |
| 198 | const QuicPacketHeader& header, |
| 199 | const QuicFrame& frame) { |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 200 | QuicFramer framer(kQuicVersion1, QuicTime::Zero(), false); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 201 | QuicFrames frames; |
| 202 | frames.push_back(frame); |
| 203 | scoped_ptr<QuicPacket> packet( |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 204 | framer.ConstructFrameDataPacket(header, frames).packet); |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 205 | return scoped_ptr<QuicEncryptedPacket>(framer.EncryptPacket( |
| 206 | ENCRYPTION_NONE, header.packet_sequence_number, *packet)); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 207 | } |
| 208 | |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 209 | void InitializeHeader(QuicPacketSequenceNumber sequence_number, |
| 210 | bool should_include_version) { |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 211 | header_.public_header.guid = random_generator_.RandUint64(); |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 212 | header_.public_header.reset_flag = false; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 213 | header_.public_header.version_flag = should_include_version; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 214 | header_.packet_sequence_number = sequence_number; |
| 215 | header_.fec_group = 0; |
[email protected] | 9db44391 | 2013-02-25 05:27:03 | [diff] [blame] | 216 | header_.entropy_flag = false; |
| 217 | header_.fec_flag = false; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | void CreateSession() { |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 221 | params_.enable_quic = true; |
| 222 | params_.quic_clock = clock_; |
| 223 | params_.quic_random = &random_generator_; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 224 | params_.client_socket_factory = &socket_factory_; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 225 | params_.quic_crypto_client_stream_factory = &crypto_client_stream_factory_; |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 226 | params_.host_resolver = &host_resolver_; |
| 227 | params_.cert_verifier = &cert_verifier_; |
| 228 | params_.proxy_service = proxy_service_.get(); |
| 229 | params_.ssl_config_service = ssl_config_service_.get(); |
| 230 | params_.http_auth_handler_factory = auth_handler_factory_.get(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 231 | params_.http_server_properties = &http_server_properties; |
| 232 | |
| 233 | session_ = new HttpNetworkSession(params_); |
| 234 | } |
| 235 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 236 | void CheckWasQuicResponse(const scoped_ptr<HttpNetworkTransaction>& trans) { |
| 237 | const HttpResponseInfo* response = trans->GetResponseInfo(); |
| 238 | ASSERT_TRUE(response != NULL); |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame^] | 239 | ASSERT_TRUE(response->headers.get() != NULL); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 240 | EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
| 241 | EXPECT_TRUE(response->was_fetched_via_spdy); |
| 242 | EXPECT_TRUE(response->was_npn_negotiated); |
| 243 | EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3, |
| 244 | response->connection_info); |
| 245 | } |
| 246 | |
| 247 | void CheckWasHttpResponse(const scoped_ptr<HttpNetworkTransaction>& trans) { |
| 248 | const HttpResponseInfo* response = trans->GetResponseInfo(); |
| 249 | ASSERT_TRUE(response != NULL); |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame^] | 250 | ASSERT_TRUE(response->headers.get() != NULL); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 251 | EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
| 252 | EXPECT_FALSE(response->was_fetched_via_spdy); |
| 253 | EXPECT_FALSE(response->was_npn_negotiated); |
| 254 | EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, |
| 255 | response->connection_info); |
| 256 | } |
| 257 | |
| 258 | void CheckResponseData(HttpNetworkTransaction* trans, |
| 259 | const std::string& expected) { |
| 260 | std::string response_data; |
| 261 | ASSERT_EQ(OK, ReadTransaction(trans, &response_data)); |
| 262 | EXPECT_EQ(expected, response_data); |
| 263 | } |
| 264 | |
| 265 | void RunTransaction(HttpNetworkTransaction* trans) { |
| 266 | TestCompletionCallback callback; |
| 267 | int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); |
| 268 | EXPECT_EQ(ERR_IO_PENDING, rv); |
| 269 | EXPECT_EQ(OK, callback.WaitForResult()); |
| 270 | } |
| 271 | |
| 272 | void SendRequestAndExpectHttpResponse(const std::string& expected) { |
| 273 | scoped_ptr<HttpNetworkTransaction> trans( |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame^] | 274 | new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 275 | RunTransaction(trans.get()); |
| 276 | CheckWasHttpResponse(trans); |
| 277 | CheckResponseData(trans.get(), expected); |
| 278 | } |
| 279 | |
| 280 | void SendRequestAndExpectQuicResponse(const std::string& expected) { |
| 281 | scoped_ptr<HttpNetworkTransaction> trans( |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame^] | 282 | new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 283 | RunTransaction(trans.get()); |
| 284 | CheckWasQuicResponse(trans); |
| 285 | CheckResponseData(trans.get(), expected); |
| 286 | } |
| 287 | |
| 288 | void AddQuicAlternateProtocolMapping( |
| 289 | MockCryptoClientStream::HandshakeMode handshake_mode) { |
| 290 | crypto_client_stream_factory_.set_handshake_mode(handshake_mode); |
| 291 | session_->http_server_properties()->SetAlternateProtocol( |
| 292 | HostPortPair::FromURL(request_.url), 80, QUIC); |
| 293 | } |
| 294 | |
| 295 | void ExpectBrokenAlternateProtocolMapping() { |
| 296 | ASSERT_TRUE(session_->http_server_properties()->HasAlternateProtocol( |
| 297 | HostPortPair::FromURL(request_.url))); |
| 298 | const PortAlternateProtocolPair alternate = |
| 299 | session_->http_server_properties()->GetAlternateProtocol( |
| 300 | HostPortPair::FromURL(request_.url)); |
| 301 | EXPECT_EQ(ALTERNATE_PROTOCOL_BROKEN, alternate.protocol); |
| 302 | } |
| 303 | |
| 304 | void AddHangingNonAlternateProtocolSocketData() { |
| 305 | MockConnect never_finishing_connect(SYNCHRONOUS, ERR_IO_PENDING); |
| 306 | StaticSocketDataProvider data(NULL, 0, NULL, 0); |
| 307 | data.set_connect_data(never_finishing_connect); |
| 308 | socket_factory_.AddSocketDataProvider(&data); |
| 309 | } |
| 310 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 311 | QuicPacketHeader header_; |
| 312 | scoped_refptr<HttpNetworkSession> session_; |
| 313 | MockClientSocketFactory socket_factory_; |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 314 | MockCryptoClientStreamFactory crypto_client_stream_factory_; |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 315 | MockClock* clock_; // Owned by QuicStreamFactory after CreateSession. |
| 316 | MockHostResolver host_resolver_; |
| 317 | MockCertVerifier cert_verifier_; |
| 318 | scoped_refptr<SSLConfigServiceDefaults> ssl_config_service_; |
| 319 | scoped_ptr<ProxyService> proxy_service_; |
[email protected] | c244c5a1 | 2013-05-07 20:55:04 | [diff] [blame] | 320 | scoped_ptr<QuicSpdyCompressor> compressor_; |
[email protected] | 1c04f952 | 2013-02-21 20:32:43 | [diff] [blame] | 321 | scoped_ptr<HttpAuthHandlerFactory> auth_handler_factory_; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 322 | MockRandom random_generator_; |
| 323 | HttpServerPropertiesImpl http_server_properties; |
| 324 | HttpNetworkSession::Params params_; |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 325 | HttpRequestInfo request_; |
| 326 | CapturingBoundNetLog net_log_; |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 327 | }; |
| 328 | |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 329 | TEST_F(QuicNetworkTransactionTest, ForceQuic) { |
| 330 | params_.origin_port_to_force_quic_on = 80; |
| 331 | |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 332 | QuicStreamId stream_id = 3; |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 333 | scoped_ptr<QuicEncryptedPacket> req( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 334 | ConstructDataPacket(1, stream_id, true, true, 0, |
| 335 | GetRequestString("GET", "/"))); |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 336 | scoped_ptr<QuicEncryptedPacket> ack(ConstructAckPacket(1, 0)); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 337 | |
| 338 | MockWrite quic_writes[] = { |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 339 | MockWrite(SYNCHRONOUS, req->data(), req->length()), |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 340 | MockWrite(SYNCHRONOUS, ack->data(), ack->length()), |
| 341 | }; |
| 342 | |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 343 | scoped_ptr<QuicEncryptedPacket> resp( |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 344 | ConstructDataPacket( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 345 | 1, stream_id, false, true, 0, GetResponseString("200 OK", "hello!"))); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 346 | MockRead quic_reads[] = { |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 347 | MockRead(SYNCHRONOUS, resp->data(), resp->length()), |
| 348 | MockRead(ASYNC, OK), // EOF |
| 349 | }; |
| 350 | |
| 351 | DelayedSocketData quic_data( |
| 352 | 1, // wait for one write to finish before reading. |
| 353 | quic_reads, arraysize(quic_reads), |
| 354 | quic_writes, arraysize(quic_writes)); |
| 355 | |
| 356 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 357 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 358 | // The non-alternate protocol job needs to hang in order to guarantee that |
| 359 | // the alternate-protocol job will "win". |
| 360 | AddHangingNonAlternateProtocolSocketData(); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 361 | |
| 362 | CreateSession(); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 363 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 364 | SendRequestAndExpectQuicResponse("hello!"); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 365 | |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 366 | // Check that the NetLog was filled reasonably. |
| 367 | net::CapturingNetLog::CapturedEntryList entries; |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 368 | net_log_.GetEntries(&entries); |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 369 | EXPECT_LT(0u, entries.size()); |
| 370 | |
| 371 | // Check that we logged a QUIC_SESSION_PACKET_RECEIVED. |
| 372 | int pos = net::ExpectLogContainsSomewhere( |
| 373 | entries, 0, |
| 374 | net::NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, |
| 375 | net::NetLog::PHASE_NONE); |
| 376 | EXPECT_LT(0, pos); |
| 377 | |
| 378 | // ... and also a TYPE_QUIC_SESSION_PACKET_HEADER_RECEIVED. |
| 379 | pos = net::ExpectLogContainsSomewhere( |
| 380 | entries, 0, |
| 381 | net::NetLog::TYPE_QUIC_SESSION_PACKET_HEADER_RECEIVED, |
| 382 | net::NetLog::PHASE_NONE); |
| 383 | EXPECT_LT(0, pos); |
| 384 | |
| 385 | std::string packet_sequence_number; |
| 386 | ASSERT_TRUE(entries[pos].GetStringValue( |
| 387 | "packet_sequence_number", &packet_sequence_number)); |
| 388 | EXPECT_EQ("1", packet_sequence_number); |
| 389 | |
| 390 | // ... and also a QUIC_SESSION_STREAM_FRAME_RECEIVED. |
| 391 | pos = net::ExpectLogContainsSomewhere( |
| 392 | entries, 0, |
| 393 | net::NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_RECEIVED, |
| 394 | net::NetLog::PHASE_NONE); |
| 395 | EXPECT_LT(0, pos); |
| 396 | |
| 397 | int log_stream_id; |
| 398 | ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &log_stream_id)); |
| 399 | EXPECT_EQ(stream_id, static_cast<QuicStreamId>(log_stream_id)); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 400 | } |
| 401 | |
[email protected] | cebe328 | 2013-05-22 23:49:30 | [diff] [blame] | 402 | TEST_F(QuicNetworkTransactionTest, ForceQuicWithErrorConnecting) { |
| 403 | params_.origin_port_to_force_quic_on = 80; |
| 404 | |
| 405 | MockRead quic_reads[] = { |
| 406 | MockRead(ASYNC, ERR_SOCKET_NOT_CONNECTED), |
| 407 | }; |
| 408 | StaticSocketDataProvider quic_data(quic_reads, arraysize(quic_reads), |
| 409 | NULL, 0); |
| 410 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 411 | |
| 412 | CreateSession(); |
| 413 | |
| 414 | scoped_ptr<HttpNetworkTransaction> trans( |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame^] | 415 | new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
[email protected] | cebe328 | 2013-05-22 23:49:30 | [diff] [blame] | 416 | TestCompletionCallback callback; |
| 417 | int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); |
| 418 | EXPECT_EQ(ERR_IO_PENDING, rv); |
| 419 | EXPECT_EQ(ERR_SOCKET_NOT_CONNECTED, callback.WaitForResult()); |
| 420 | } |
| 421 | |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 422 | TEST_F(QuicNetworkTransactionTest, DoNotForceQuicForHttps) { |
| 423 | // Attempt to "force" quic on 443, which will not be honored. |
| 424 | params_.origin_port_to_force_quic_on = 443; |
| 425 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 426 | MockRead http_reads[] = { |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 427 | MockRead("HTTP/1.1 200 OK\r\n\r\n"), |
| 428 | MockRead("hello world"), |
| 429 | MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), |
| 430 | MockRead(ASYNC, OK) |
| 431 | }; |
| 432 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 433 | StaticSocketDataProvider data(http_reads, arraysize(http_reads), NULL, 0); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 434 | socket_factory_.AddSocketDataProvider(&data); |
| 435 | SSLSocketDataProvider ssl(ASYNC, OK); |
| 436 | socket_factory_.AddSSLSocketDataProvider(&ssl); |
| 437 | |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 438 | CreateSession(); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 439 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 440 | SendRequestAndExpectHttpResponse("hello world"); |
[email protected] | 4dca587c | 2013-03-07 16:54:47 | [diff] [blame] | 441 | } |
| 442 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 443 | TEST_F(QuicNetworkTransactionTest, UseAlternateProtocolForQuic) { |
| 444 | HttpStreamFactory::set_use_alternate_protocols(true); |
| 445 | HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 446 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 447 | MockRead http_reads[] = { |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 448 | MockRead("HTTP/1.1 200 OK\r\n"), |
| 449 | MockRead(kQuicAlternateProtocolHttpHeader), |
| 450 | MockRead("hello world"), |
| 451 | MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), |
| 452 | MockRead(ASYNC, OK) |
| 453 | }; |
| 454 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 455 | StaticSocketDataProvider http_data(http_reads, arraysize(http_reads), |
| 456 | NULL, 0); |
| 457 | socket_factory_.AddSocketDataProvider(&http_data); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 458 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 459 | scoped_ptr<QuicEncryptedPacket> req( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 460 | ConstructDataPacket(1, 3, true, true, 0, GetRequestString("GET", "/"))); |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 461 | scoped_ptr<QuicEncryptedPacket> ack(ConstructAckPacket(1, 0)); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 462 | |
| 463 | MockWrite quic_writes[] = { |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 464 | MockWrite(SYNCHRONOUS, req->data(), req->length()), |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 465 | MockWrite(SYNCHRONOUS, ack->data(), ack->length()), |
| 466 | }; |
| 467 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 468 | scoped_ptr<QuicEncryptedPacket> resp( |
[email protected] | e8ff2684 | 2013-03-22 21:02:05 | [diff] [blame] | 469 | ConstructDataPacket( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 470 | 1, 3, false, true, 0, GetResponseString("200 OK", "hello!"))); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 471 | MockRead quic_reads[] = { |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 472 | MockRead(SYNCHRONOUS, resp->data(), resp->length()), |
| 473 | MockRead(ASYNC, OK), // EOF |
| 474 | }; |
| 475 | |
| 476 | DelayedSocketData quic_data( |
| 477 | 1, // wait for one write to finish before reading. |
| 478 | quic_reads, arraysize(quic_reads), |
| 479 | quic_writes, arraysize(quic_writes)); |
| 480 | |
| 481 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 482 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 483 | // The non-alternate protocol job needs to hang in order to guarantee that |
| 484 | // the alternate-protocol job will "win". |
| 485 | AddHangingNonAlternateProtocolSocketData(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 486 | |
| 487 | CreateSession(); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 488 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 489 | SendRequestAndExpectHttpResponse("hello world"); |
| 490 | SendRequestAndExpectQuicResponse("hello!"); |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 491 | } |
| 492 | |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 493 | TEST_F(QuicNetworkTransactionTest, DontUseAlternateProtocolForQuicHttps) { |
| 494 | HttpStreamFactory::set_use_alternate_protocols(true); |
| 495 | HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
| 496 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 497 | MockRead http_reads[] = { |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 498 | MockRead("HTTP/1.1 200 OK\r\n"), |
| 499 | MockRead("Content-length: 11\r\n"), |
| 500 | MockRead(kQuicAlternateProtocolHttpHeader), |
| 501 | MockRead("hello world"), |
| 502 | |
| 503 | MockRead("HTTP/1.1 200 OK\r\n"), |
| 504 | MockRead("Content-length: 6\r\n"), |
| 505 | MockRead(kQuicAlternateProtocolHttpHeader), |
| 506 | MockRead("hello!"), |
| 507 | }; |
| 508 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 509 | StaticSocketDataProvider data(http_reads, arraysize(http_reads), NULL, 0); |
| 510 | socket_factory_.AddSocketDataProvider(&data); |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 511 | SSLSocketDataProvider ssl(ASYNC, OK); |
| 512 | socket_factory_.AddSSLSocketDataProvider(&ssl); |
| 513 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 514 | request_.url = GURL("https://www.google.com/"); |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 515 | |
| 516 | CreateSession(); |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 517 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 518 | SendRequestAndExpectHttpResponse("hello world"); |
| 519 | SendRequestAndExpectHttpResponse("hello!"); |
[email protected] | ff899c8 | 2013-03-12 23:10:50 | [diff] [blame] | 520 | } |
| 521 | |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 522 | TEST_F(QuicNetworkTransactionTest, ZeroRTT) { |
| 523 | HttpStreamFactory::set_use_alternate_protocols(true); |
| 524 | HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
| 525 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 526 | scoped_ptr<QuicEncryptedPacket> req( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 527 | ConstructDataPacket(1, 3, true, true, 0, GetRequestString("GET", "/"))); |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 528 | scoped_ptr<QuicEncryptedPacket> ack(ConstructAckPacket(1, 0)); |
| 529 | |
| 530 | MockWrite quic_writes[] = { |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 531 | MockWrite(SYNCHRONOUS, req->data(), req->length()), |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 532 | MockWrite(SYNCHRONOUS, ack->data(), ack->length()), |
| 533 | }; |
| 534 | |
| 535 | scoped_ptr<QuicEncryptedPacket> resp( |
| 536 | ConstructDataPacket( |
[email protected] | 98b20ce | 2013-05-10 05:55:26 | [diff] [blame] | 537 | 1, 3, false, true, 0, GetResponseString("200 OK", "hello!"))); |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 538 | MockRead quic_reads[] = { |
| 539 | MockRead(SYNCHRONOUS, resp->data(), resp->length()), |
| 540 | MockRead(ASYNC, OK), // EOF |
| 541 | }; |
| 542 | |
| 543 | DelayedSocketData quic_data( |
| 544 | 1, // wait for one write to finish before reading. |
| 545 | quic_reads, arraysize(quic_reads), |
| 546 | quic_writes, arraysize(quic_writes)); |
| 547 | |
| 548 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 549 | |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 550 | CreateSession(); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 551 | AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT); |
| 552 | SendRequestAndExpectQuicResponse("hello!"); |
[email protected] | 8ba8121 | 2013-05-03 13:11:48 | [diff] [blame] | 553 | } |
| 554 | |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 555 | TEST_F(QuicNetworkTransactionTest, BrokenAlternateProtocol) { |
| 556 | HttpStreamFactory::set_use_alternate_protocols(true); |
| 557 | HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
| 558 | |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 559 | // Alternate-protocol job |
| 560 | scoped_ptr<QuicEncryptedPacket> close(ConstructConnectionClosePacket(1)); |
| 561 | MockRead quic_reads[] = { |
| 562 | MockRead(ASYNC, close->data(), close->length()), |
| 563 | MockRead(ASYNC, OK), // EOF |
| 564 | }; |
| 565 | StaticSocketDataProvider quic_data(quic_reads, arraysize(quic_reads), |
| 566 | NULL, 0); |
| 567 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 568 | |
| 569 | // Main job which will succeed even though the alternate job fails. |
| 570 | MockRead http_reads[] = { |
| 571 | MockRead("HTTP/1.1 200 OK\r\n\r\n"), |
| 572 | MockRead("hello from http"), |
| 573 | MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), |
| 574 | MockRead(ASYNC, OK) |
| 575 | }; |
| 576 | |
| 577 | StaticSocketDataProvider http_data(http_reads, arraysize(http_reads), |
| 578 | NULL, 0); |
| 579 | socket_factory_.AddSocketDataProvider(&http_data); |
| 580 | |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 581 | CreateSession(); |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 582 | AddQuicAlternateProtocolMapping(MockCryptoClientStream::COLD_START); |
| 583 | SendRequestAndExpectHttpResponse("hello from http"); |
| 584 | ExpectBrokenAlternateProtocolMapping(); |
[email protected] | 3316d42 | 2013-05-03 21:45:30 | [diff] [blame] | 585 | } |
| 586 | |
[email protected] | d03a66d | 2013-05-06 12:55:59 | [diff] [blame] | 587 | TEST_F(QuicNetworkTransactionTest, BrokenAlternateProtocolReadError) { |
| 588 | HttpStreamFactory::set_use_alternate_protocols(true); |
| 589 | HttpStreamFactory::SetNextProtos(QuicNextProtos()); |
| 590 | |
[email protected] | d03a66d | 2013-05-06 12:55:59 | [diff] [blame] | 591 | // Alternate-protocol job |
| 592 | MockRead quic_reads[] = { |
| 593 | MockRead(ASYNC, ERR_SOCKET_NOT_CONNECTED), |
| 594 | }; |
| 595 | StaticSocketDataProvider quic_data(quic_reads, arraysize(quic_reads), |
| 596 | NULL, 0); |
| 597 | socket_factory_.AddSocketDataProvider(&quic_data); |
| 598 | |
| 599 | // Main job which will succeed even though the alternate job fails. |
| 600 | MockRead http_reads[] = { |
| 601 | MockRead("HTTP/1.1 200 OK\r\n\r\n"), |
| 602 | MockRead("hello from http"), |
| 603 | MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ), |
| 604 | MockRead(ASYNC, OK) |
| 605 | }; |
| 606 | |
| 607 | StaticSocketDataProvider http_data(http_reads, arraysize(http_reads), |
| 608 | NULL, 0); |
| 609 | socket_factory_.AddSocketDataProvider(&http_data); |
| 610 | |
[email protected] | d03a66d | 2013-05-06 12:55:59 | [diff] [blame] | 611 | CreateSession(); |
[email protected] | d03a66d | 2013-05-06 12:55:59 | [diff] [blame] | 612 | |
[email protected] | aa9b14d | 2013-05-10 23:45:19 | [diff] [blame] | 613 | AddQuicAlternateProtocolMapping(MockCryptoClientStream::COLD_START); |
| 614 | SendRequestAndExpectHttpResponse("hello from http"); |
| 615 | ExpectBrokenAlternateProtocolMapping(); |
[email protected] | d03a66d | 2013-05-06 12:55:59 | [diff] [blame] | 616 | } |
| 617 | |
[email protected] | 61a52778 | 2013-02-21 03:58:00 | [diff] [blame] | 618 | } // namespace test |
| 619 | } // namespace net |