| Index: net/http/http_network_transaction_spdy2_unittest.cc
|
| diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc
|
| index 10e83a4e3571ffe89a20f5719df9776f53ebaedd..f01fcb45137ca26c50924722ef8855dcef6b82c8 100644
|
| --- a/net/http/http_network_transaction_spdy2_unittest.cc
|
| +++ b/net/http/http_network_transaction_spdy2_unittest.cc
|
| @@ -9493,121 +9493,6 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MultiRoundAuth) {
|
| EXPECT_EQ(1, transport_pool->IdleSocketCountInGroup(kSocketGroup));
|
| }
|
|
|
| -class TLSDecompressionFailureSocketDataProvider : public SocketDataProvider {
|
| - public:
|
| - explicit TLSDecompressionFailureSocketDataProvider(bool fail_all)
|
| - : fail_all_(fail_all) {
|
| - }
|
| -
|
| - virtual MockRead GetNextRead() OVERRIDE {
|
| - if (fail_all_)
|
| - return MockRead(SYNCHRONOUS, ERR_SSL_DECOMPRESSION_FAILURE_ALERT);
|
| -
|
| - return MockRead(SYNCHRONOUS,
|
| - "HTTP/1.1 200 OK\r\nContent-Length: 3\r\n\r\nok.\r\n");
|
| - }
|
| -
|
| - virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE {
|
| - return MockWriteResult(SYNCHRONOUS /* async */, data.size());
|
| - }
|
| -
|
| - virtual void Reset() OVERRIDE {
|
| - }
|
| -
|
| - private:
|
| - const bool fail_all_;
|
| -};
|
| -
|
| -// Test that we restart a connection when we see a decompression failure from
|
| -// the peer during the handshake. (In the real world we'll restart with SSLv3
|
| -// and we won't offer DEFLATE in that case.)
|
| -TEST_F(HttpNetworkTransactionSpdy2Test, RestartAfterTLSDecompressionFailure) {
|
| - HttpRequestInfo request;
|
| - request.method = "GET";
|
| - request.url = GURL("https://tlsdecompressionfailure.example.com/");
|
| - request.load_flags = 0;
|
| -
|
| - SpdySessionDependencies session_deps;
|
| - TLSDecompressionFailureSocketDataProvider socket_data_provider1(
|
| - false /* fail all reads */);
|
| - TLSDecompressionFailureSocketDataProvider socket_data_provider2(false);
|
| - SSLSocketDataProvider ssl_socket_data_provider1(
|
| - SYNCHRONOUS, ERR_SSL_DECOMPRESSION_FAILURE_ALERT);
|
| - SSLSocketDataProvider ssl_socket_data_provider2(SYNCHRONOUS, OK);
|
| - session_deps.socket_factory->AddSocketDataProvider(&socket_data_provider1);
|
| - session_deps.socket_factory->AddSocketDataProvider(&socket_data_provider2);
|
| - session_deps.socket_factory->AddSSLSocketDataProvider(
|
| - &ssl_socket_data_provider1);
|
| - session_deps.socket_factory->AddSSLSocketDataProvider(
|
| - &ssl_socket_data_provider2);
|
| -
|
| - // Work around http://crbug.com/37454
|
| - StaticSocketDataProvider bug37454_connection;
|
| - bug37454_connection.set_connect_data(MockConnect(ASYNC, ERR_UNEXPECTED));
|
| - session_deps.socket_factory->AddSocketDataProvider(&bug37454_connection);
|
| -
|
| - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
|
| - scoped_ptr<HttpTransaction> trans(
|
| - new HttpNetworkTransaction(DEFAULT_PRIORITY, session));
|
| - TestCompletionCallback callback;
|
| -
|
| - int rv = trans->Start(&request, callback.callback(), BoundNetLog());
|
| - EXPECT_EQ(ERR_IO_PENDING, rv);
|
| - EXPECT_EQ(OK, callback.WaitForResult());
|
| -
|
| - const HttpResponseInfo* response = trans->GetResponseInfo();
|
| - ASSERT_TRUE(response != NULL);
|
| - ASSERT_TRUE(response->headers != NULL);
|
| - EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
|
| -
|
| - std::string response_data;
|
| - ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
|
| - EXPECT_EQ("ok.", response_data);
|
| -}
|
| -
|
| -// Test that we restart a connection if we get a decompression failure from the
|
| -// peer while reading the first bytes from the connection. This occurs when the
|
| -// peer cannot handle DEFLATE but we're using False Start, so we don't notice
|
| -// in the handshake.
|
| -TEST_F(HttpNetworkTransactionSpdy2Test,
|
| - RestartAfterTLSDecompressionFailureWithFalseStart) {
|
| - HttpRequestInfo request;
|
| - request.method = "GET";
|
| - request.url = GURL("https://tlsdecompressionfailure2.example.com/");
|
| - request.load_flags = 0;
|
| -
|
| - SpdySessionDependencies session_deps;
|
| - TLSDecompressionFailureSocketDataProvider socket_data_provider1(
|
| - true /* fail all reads */);
|
| - TLSDecompressionFailureSocketDataProvider socket_data_provider2(false);
|
| - SSLSocketDataProvider ssl_socket_data_provider1(SYNCHRONOUS, OK);
|
| - SSLSocketDataProvider ssl_socket_data_provider2(SYNCHRONOUS, OK);
|
| - session_deps.socket_factory->AddSocketDataProvider(&socket_data_provider1);
|
| - session_deps.socket_factory->AddSocketDataProvider(&socket_data_provider2);
|
| - session_deps.socket_factory->AddSSLSocketDataProvider(
|
| - &ssl_socket_data_provider1);
|
| - session_deps.socket_factory->AddSSLSocketDataProvider(
|
| - &ssl_socket_data_provider2);
|
| -
|
| - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps));
|
| - scoped_ptr<HttpTransaction> trans(
|
| - new HttpNetworkTransaction(DEFAULT_PRIORITY, session));
|
| - TestCompletionCallback callback;
|
| -
|
| - int rv = trans->Start(&request, callback.callback(), BoundNetLog());
|
| - EXPECT_EQ(ERR_IO_PENDING, rv);
|
| - EXPECT_EQ(OK, callback.WaitForResult());
|
| -
|
| - const HttpResponseInfo* response = trans->GetResponseInfo();
|
| - ASSERT_TRUE(response != NULL);
|
| - ASSERT_TRUE(response->headers != NULL);
|
| - EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
|
| -
|
| - std::string response_data;
|
| - ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data));
|
| - EXPECT_EQ("ok.", response_data);
|
| -}
|
| -
|
| // This tests the case that a request is issued via http instead of spdy after
|
| // npn is negotiated.
|
| TEST_F(HttpNetworkTransactionSpdy2Test, NpnWithHttpOverSSL) {
|
|
|