OLD | NEW |
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 "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 SETTINGS_FLAG_PLEASE_PERSIST, | 1583 SETTINGS_FLAG_PLEASE_PERSIST, |
1584 initial_max_concurrent_streams); | 1584 initial_max_concurrent_streams); |
1585 | 1585 |
1586 SpdySessionPoolPeer pool_peer(spdy_session_pool_); | 1586 SpdySessionPoolPeer pool_peer(spdy_session_pool_); |
1587 pool_peer.SetEnableSendingInitialData(true); | 1587 pool_peer.SetEnableSendingInitialData(true); |
1588 | 1588 |
1589 base::WeakPtr<SpdySession> session = | 1589 base::WeakPtr<SpdySession> session = |
1590 CreateInsecureSpdySession(http_session_, key_, BoundNetLog()); | 1590 CreateInsecureSpdySession(http_session_, key_, BoundNetLog()); |
1591 | 1591 |
1592 base::MessageLoop::current()->RunUntilIdle(); | 1592 base::MessageLoop::current()->RunUntilIdle(); |
1593 EXPECT_TRUE(data.AllWriteDataConsumed()); | 1593 EXPECT_TRUE(data.at_write_eof()); |
1594 } | 1594 } |
1595 | 1595 |
1596 TEST_P(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) { | 1596 TEST_P(SpdySessionTest, ClearSettingsStorageOnIPAddressChanged) { |
1597 CreateNetworkSession(); | 1597 CreateNetworkSession(); |
1598 | 1598 |
1599 base::WeakPtr<HttpServerProperties> test_http_server_properties = | 1599 base::WeakPtr<HttpServerProperties> test_http_server_properties = |
1600 spdy_session_pool_->http_server_properties(); | 1600 spdy_session_pool_->http_server_properties(); |
1601 SettingsFlagsAndValue flags_and_value1(SETTINGS_FLAG_PLEASE_PERSIST, 2); | 1601 SettingsFlagsAndValue flags_and_value1(SETTINGS_FLAG_PLEASE_PERSIST, 2); |
1602 test_http_server_properties->SetSpdySetting( | 1602 test_http_server_properties->SetSpdySetting( |
1603 test_host_port_pair_, | 1603 test_host_port_pair_, |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2760 EXPECT_EQ(0u, observer.executed_count()); | 2760 EXPECT_EQ(0u, observer.executed_count()); |
2761 | 2761 |
2762 // Read all the data and verify SpdySession::DoReadLoop has not | 2762 // Read all the data and verify SpdySession::DoReadLoop has not |
2763 // posted a task. | 2763 // posted a task. |
2764 data.RunFor(4); | 2764 data.RunFor(4); |
2765 EXPECT_EQ(NULL, spdy_stream1.get()); | 2765 EXPECT_EQ(NULL, spdy_stream1.get()); |
2766 | 2766 |
2767 // Verify task observer's executed_count is zero, which indicates DoRead read | 2767 // Verify task observer's executed_count is zero, which indicates DoRead read |
2768 // all the available data. | 2768 // all the available data. |
2769 EXPECT_EQ(0u, observer.executed_count()); | 2769 EXPECT_EQ(0u, observer.executed_count()); |
2770 EXPECT_TRUE(data.AllWriteDataConsumed()); | 2770 EXPECT_TRUE(data.at_write_eof()); |
2771 EXPECT_TRUE(data.AllReadDataConsumed()); | 2771 EXPECT_TRUE(data.at_read_eof()); |
2772 } | 2772 } |
2773 | 2773 |
2774 // Test that SpdySession::DoReadLoop yields while reading the | 2774 // Test that SpdySession::DoReadLoop yields while reading the |
2775 // data. This test makes 32k + 1 bytes of data available on the socket | 2775 // data. This test makes 32k + 1 bytes of data available on the socket |
2776 // for reading. It then verifies that DoRead has yielded even though | 2776 // for reading. It then verifies that DoRead has yielded even though |
2777 // there is data available for it to read (i.e, socket()->Read didn't | 2777 // there is data available for it to read (i.e, socket()->Read didn't |
2778 // return ERR_IO_PENDING during socket reads). | 2778 // return ERR_IO_PENDING during socket reads). |
2779 TEST_P(SpdySessionTest, TestYieldingDuringReadData) { | 2779 TEST_P(SpdySessionTest, TestYieldingDuringReadData) { |
2780 MockConnect connect_data(SYNCHRONOUS, OK); | 2780 MockConnect connect_data(SYNCHRONOUS, OK); |
2781 BufferedSpdyFramer framer(spdy_util_.spdy_version(), false); | 2781 BufferedSpdyFramer framer(spdy_util_.spdy_version(), false); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 | 2852 |
2853 // Read all the data and verify SpdySession::DoReadLoop has posted a | 2853 // Read all the data and verify SpdySession::DoReadLoop has posted a |
2854 // task. | 2854 // task. |
2855 data.RunFor(6); | 2855 data.RunFor(6); |
2856 EXPECT_EQ(NULL, spdy_stream1.get()); | 2856 EXPECT_EQ(NULL, spdy_stream1.get()); |
2857 | 2857 |
2858 // Verify task observer's executed_count is 1, which indicates DoRead has | 2858 // Verify task observer's executed_count is 1, which indicates DoRead has |
2859 // posted only one task and thus yielded though there is data available for it | 2859 // posted only one task and thus yielded though there is data available for it |
2860 // to read. | 2860 // to read. |
2861 EXPECT_EQ(1u, observer.executed_count()); | 2861 EXPECT_EQ(1u, observer.executed_count()); |
2862 EXPECT_TRUE(data.AllWriteDataConsumed()); | 2862 EXPECT_TRUE(data.at_write_eof()); |
2863 EXPECT_TRUE(data.AllReadDataConsumed()); | 2863 EXPECT_TRUE(data.at_read_eof()); |
2864 } | 2864 } |
2865 | 2865 |
2866 // Test that SpdySession::DoReadLoop() tests interactions of yielding | 2866 // Test that SpdySession::DoReadLoop() tests interactions of yielding |
2867 // + async, by doing the following MockReads. | 2867 // + async, by doing the following MockReads. |
2868 // | 2868 // |
2869 // MockRead of SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 2K | 2869 // MockRead of SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 2K |
2870 // ASYNC 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 2K. | 2870 // ASYNC 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 8K, SYNCHRONOUS 2K. |
2871 // | 2871 // |
2872 // The above reads 26K synchronously. Since that is less that 32K, we | 2872 // The above reads 26K synchronously. Since that is less that 32K, we |
2873 // will attempt to read again. However, that DoRead() will return | 2873 // will attempt to read again. However, that DoRead() will return |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 | 2963 |
2964 // Read all the data and verify SpdySession::DoReadLoop has posted a | 2964 // Read all the data and verify SpdySession::DoReadLoop has posted a |
2965 // task. | 2965 // task. |
2966 data.RunFor(12); | 2966 data.RunFor(12); |
2967 EXPECT_EQ(NULL, spdy_stream1.get()); | 2967 EXPECT_EQ(NULL, spdy_stream1.get()); |
2968 | 2968 |
2969 // Verify task observer's executed_count is 1, which indicates DoRead has | 2969 // Verify task observer's executed_count is 1, which indicates DoRead has |
2970 // posted only one task and thus yielded though there is data available for | 2970 // posted only one task and thus yielded though there is data available for |
2971 // it to read. | 2971 // it to read. |
2972 EXPECT_EQ(1u, observer.executed_count()); | 2972 EXPECT_EQ(1u, observer.executed_count()); |
2973 EXPECT_TRUE(data.AllWriteDataConsumed()); | 2973 EXPECT_TRUE(data.at_write_eof()); |
2974 EXPECT_TRUE(data.AllReadDataConsumed()); | 2974 EXPECT_TRUE(data.at_read_eof()); |
2975 } | 2975 } |
2976 | 2976 |
2977 // Send a GoAway frame when SpdySession is in DoReadLoop. Make sure | 2977 // Send a GoAway frame when SpdySession is in DoReadLoop. Make sure |
2978 // nothing blows up. | 2978 // nothing blows up. |
2979 TEST_P(SpdySessionTest, GoAwayWhileInDoReadLoop) { | 2979 TEST_P(SpdySessionTest, GoAwayWhileInDoReadLoop) { |
2980 MockConnect connect_data(SYNCHRONOUS, OK); | 2980 MockConnect connect_data(SYNCHRONOUS, OK); |
2981 BufferedSpdyFramer framer(spdy_util_.spdy_version(), false); | 2981 BufferedSpdyFramer framer(spdy_util_.spdy_version(), false); |
2982 | 2982 |
2983 scoped_ptr<SpdyFrame> req1( | 2983 scoped_ptr<SpdyFrame> req1( |
2984 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, MEDIUM, true)); | 2984 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, MEDIUM, true)); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 EXPECT_TRUE(spdy_stream1->HasUrlFromHeaders()); | 3023 EXPECT_TRUE(spdy_stream1->HasUrlFromHeaders()); |
3024 | 3024 |
3025 // Run until 1st read. | 3025 // Run until 1st read. |
3026 EXPECT_EQ(0u, spdy_stream1->stream_id()); | 3026 EXPECT_EQ(0u, spdy_stream1->stream_id()); |
3027 data.RunFor(1); | 3027 data.RunFor(1); |
3028 EXPECT_EQ(1u, spdy_stream1->stream_id()); | 3028 EXPECT_EQ(1u, spdy_stream1->stream_id()); |
3029 | 3029 |
3030 // Run until GoAway. | 3030 // Run until GoAway. |
3031 data.RunFor(3); | 3031 data.RunFor(3); |
3032 EXPECT_EQ(NULL, spdy_stream1.get()); | 3032 EXPECT_EQ(NULL, spdy_stream1.get()); |
3033 EXPECT_TRUE(data.AllWriteDataConsumed()); | 3033 EXPECT_TRUE(data.at_write_eof()); |
3034 EXPECT_TRUE(data.AllReadDataConsumed()); | 3034 EXPECT_TRUE(data.at_read_eof()); |
3035 EXPECT_TRUE(session == NULL); | 3035 EXPECT_TRUE(session == NULL); |
3036 } | 3036 } |
3037 | 3037 |
3038 // Within this framework, a SpdySession should be initialized with | 3038 // Within this framework, a SpdySession should be initialized with |
3039 // flow control disabled for protocol version 2, with flow control | 3039 // flow control disabled for protocol version 2, with flow control |
3040 // enabled only for streams for protocol version 3, and with flow | 3040 // enabled only for streams for protocol version 3, and with flow |
3041 // control enabled for streams and sessions for higher versions. | 3041 // control enabled for streams and sessions for higher versions. |
3042 TEST_P(SpdySessionTest, ProtocolNegotiation) { | 3042 TEST_P(SpdySessionTest, ProtocolNegotiation) { |
3043 session_deps_.host_resolver->set_synchronous_mode(true); | 3043 session_deps_.host_resolver->set_synchronous_mode(true); |
3044 | 3044 |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3931 stream->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND)); | 3931 stream->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND)); |
3932 EXPECT_TRUE(stream->HasUrlFromHeaders()); | 3932 EXPECT_TRUE(stream->HasUrlFromHeaders()); |
3933 | 3933 |
3934 const int32 initial_window_size = | 3934 const int32 initial_window_size = |
3935 SpdySession::GetDefaultInitialWindowSize(GetParam()); | 3935 SpdySession::GetDefaultInitialWindowSize(GetParam()); |
3936 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); | 3936 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); |
3937 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); | 3937 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); |
3938 | 3938 |
3939 data.RunFor(4); | 3939 data.RunFor(4); |
3940 | 3940 |
3941 EXPECT_TRUE(data.AllWriteDataConsumed()); | 3941 EXPECT_TRUE(data.at_write_eof()); |
3942 EXPECT_TRUE(data.AllReadDataConsumed()); | 3942 EXPECT_TRUE(data.at_read_eof()); |
3943 | 3943 |
3944 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); | 3944 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); |
3945 EXPECT_EQ(msg_data_size, session->session_unacked_recv_window_bytes_); | 3945 EXPECT_EQ(msg_data_size, session->session_unacked_recv_window_bytes_); |
3946 | 3946 |
3947 stream->Close(); | 3947 stream->Close(); |
3948 EXPECT_EQ(NULL, stream.get()); | 3948 EXPECT_EQ(NULL, stream.get()); |
3949 | 3949 |
3950 EXPECT_EQ(OK, delegate.WaitForClose()); | 3950 EXPECT_EQ(OK, delegate.WaitForClose()); |
3951 | 3951 |
3952 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); | 3952 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4011 const int32 initial_window_size = | 4011 const int32 initial_window_size = |
4012 SpdySession::GetDefaultInitialWindowSize(GetParam()); | 4012 SpdySession::GetDefaultInitialWindowSize(GetParam()); |
4013 EXPECT_EQ(initial_window_size, session->session_send_window_size_); | 4013 EXPECT_EQ(initial_window_size, session->session_send_window_size_); |
4014 | 4014 |
4015 data.RunFor(1); | 4015 data.RunFor(1); |
4016 | 4016 |
4017 EXPECT_EQ(initial_window_size, session->session_send_window_size_); | 4017 EXPECT_EQ(initial_window_size, session->session_send_window_size_); |
4018 | 4018 |
4019 data.RunFor(1); | 4019 data.RunFor(1); |
4020 | 4020 |
4021 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4021 EXPECT_TRUE(data.at_write_eof()); |
4022 EXPECT_TRUE(data.AllReadDataConsumed()); | 4022 EXPECT_TRUE(data.at_read_eof()); |
4023 | 4023 |
4024 EXPECT_EQ(initial_window_size - msg_data_size, | 4024 EXPECT_EQ(initial_window_size - msg_data_size, |
4025 session->session_send_window_size_); | 4025 session->session_send_window_size_); |
4026 | 4026 |
4027 // Closing the stream should increase the session's send window. | 4027 // Closing the stream should increase the session's send window. |
4028 stream->Close(); | 4028 stream->Close(); |
4029 EXPECT_EQ(NULL, stream.get()); | 4029 EXPECT_EQ(NULL, stream.get()); |
4030 | 4030 |
4031 EXPECT_EQ(initial_window_size, session->session_send_window_size_); | 4031 EXPECT_EQ(initial_window_size, session->session_send_window_size_); |
4032 | 4032 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4133 session->session_recv_window_size_); | 4133 session->session_recv_window_size_); |
4134 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); | 4134 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); |
4135 | 4135 |
4136 data.RunFor(1); | 4136 data.RunFor(1); |
4137 | 4137 |
4138 EXPECT_EQ(initial_window_size, session->session_send_window_size_); | 4138 EXPECT_EQ(initial_window_size, session->session_send_window_size_); |
4139 EXPECT_EQ(initial_window_size - msg_data_size, | 4139 EXPECT_EQ(initial_window_size - msg_data_size, |
4140 session->session_recv_window_size_); | 4140 session->session_recv_window_size_); |
4141 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); | 4141 EXPECT_EQ(0, session->session_unacked_recv_window_bytes_); |
4142 | 4142 |
4143 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4143 EXPECT_TRUE(data.at_write_eof()); |
4144 EXPECT_TRUE(data.AllReadDataConsumed()); | 4144 EXPECT_TRUE(data.at_read_eof()); |
4145 | 4145 |
4146 EXPECT_EQ(msg_data, delegate.TakeReceivedData()); | 4146 EXPECT_EQ(msg_data, delegate.TakeReceivedData()); |
4147 | 4147 |
4148 // Draining the delegate's read queue should increase the session's | 4148 // Draining the delegate's read queue should increase the session's |
4149 // receive window. | 4149 // receive window. |
4150 EXPECT_EQ(initial_window_size, session->session_send_window_size_); | 4150 EXPECT_EQ(initial_window_size, session->session_send_window_size_); |
4151 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); | 4151 EXPECT_EQ(initial_window_size, session->session_recv_window_size_); |
4152 EXPECT_EQ(msg_data_size, session->session_unacked_recv_window_bytes_); | 4152 EXPECT_EQ(msg_data_size, session->session_unacked_recv_window_bytes_); |
4153 | 4153 |
4154 stream->Close(); | 4154 stream->Close(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4232 | 4232 |
4233 EXPECT_FALSE(stream->send_stalled_by_flow_control()); | 4233 EXPECT_FALSE(stream->send_stalled_by_flow_control()); |
4234 | 4234 |
4235 data.RunFor(3); | 4235 data.RunFor(3); |
4236 | 4236 |
4237 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); | 4237 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); |
4238 | 4238 |
4239 EXPECT_TRUE(delegate.send_headers_completed()); | 4239 EXPECT_TRUE(delegate.send_headers_completed()); |
4240 EXPECT_EQ("200", delegate.GetResponseHeaderValue(":status")); | 4240 EXPECT_EQ("200", delegate.GetResponseHeaderValue(":status")); |
4241 EXPECT_EQ(std::string(), delegate.TakeReceivedData()); | 4241 EXPECT_EQ(std::string(), delegate.TakeReceivedData()); |
4242 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4242 EXPECT_TRUE(data.at_write_eof()); |
4243 } | 4243 } |
4244 | 4244 |
4245 // Run the resume-after-unstall test with all possible stall and | 4245 // Run the resume-after-unstall test with all possible stall and |
4246 // unstall sequences. | 4246 // unstall sequences. |
4247 | 4247 |
4248 TEST_P(SpdySessionTest, ResumeAfterUnstallSession) { | 4248 TEST_P(SpdySessionTest, ResumeAfterUnstallSession) { |
4249 if (GetParam() < kProtoSPDY31) | 4249 if (GetParam() < kProtoSPDY31) |
4250 return; | 4250 return; |
4251 | 4251 |
4252 RunResumeAfterUnstallTest( | 4252 RunResumeAfterUnstallTest( |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4433 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate2.WaitForClose()); | 4433 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate2.WaitForClose()); |
4434 | 4434 |
4435 EXPECT_TRUE(delegate1.send_headers_completed()); | 4435 EXPECT_TRUE(delegate1.send_headers_completed()); |
4436 EXPECT_EQ("200", delegate1.GetResponseHeaderValue(":status")); | 4436 EXPECT_EQ("200", delegate1.GetResponseHeaderValue(":status")); |
4437 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); | 4437 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); |
4438 | 4438 |
4439 EXPECT_TRUE(delegate2.send_headers_completed()); | 4439 EXPECT_TRUE(delegate2.send_headers_completed()); |
4440 EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status")); | 4440 EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status")); |
4441 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); | 4441 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); |
4442 | 4442 |
4443 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4443 EXPECT_TRUE(data.at_write_eof()); |
4444 } | 4444 } |
4445 | 4445 |
4446 // Delegate that closes a given stream after sending its body. | 4446 // Delegate that closes a given stream after sending its body. |
4447 class StreamClosingDelegate : public test::StreamDelegateWithBody { | 4447 class StreamClosingDelegate : public test::StreamDelegateWithBody { |
4448 public: | 4448 public: |
4449 StreamClosingDelegate(const base::WeakPtr<SpdyStream>& stream, | 4449 StreamClosingDelegate(const base::WeakPtr<SpdyStream>& stream, |
4450 base::StringPiece data) | 4450 base::StringPiece data) |
4451 : StreamDelegateWithBody(stream, data) {} | 4451 : StreamDelegateWithBody(stream, data) {} |
4452 | 4452 |
4453 ~StreamClosingDelegate() override {} | 4453 ~StreamClosingDelegate() override {} |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 EXPECT_TRUE(delegate1.send_headers_completed()); | 4619 EXPECT_TRUE(delegate1.send_headers_completed()); |
4620 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); | 4620 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); |
4621 | 4621 |
4622 EXPECT_TRUE(delegate2.send_headers_completed()); | 4622 EXPECT_TRUE(delegate2.send_headers_completed()); |
4623 EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status")); | 4623 EXPECT_EQ("200", delegate2.GetResponseHeaderValue(":status")); |
4624 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); | 4624 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); |
4625 | 4625 |
4626 EXPECT_TRUE(delegate3.send_headers_completed()); | 4626 EXPECT_TRUE(delegate3.send_headers_completed()); |
4627 EXPECT_EQ(std::string(), delegate3.TakeReceivedData()); | 4627 EXPECT_EQ(std::string(), delegate3.TakeReceivedData()); |
4628 | 4628 |
4629 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4629 EXPECT_TRUE(data.at_write_eof()); |
4630 } | 4630 } |
4631 | 4631 |
4632 // Cause a stall by reducing the flow control send window to | 4632 // Cause a stall by reducing the flow control send window to |
4633 // 0. Unstalling the session should properly handle the session itself | 4633 // 0. Unstalling the session should properly handle the session itself |
4634 // being closed. | 4634 // being closed. |
4635 TEST_P(SpdySessionTest, SendWindowSizeIncreaseWithDeletedSession) { | 4635 TEST_P(SpdySessionTest, SendWindowSizeIncreaseWithDeletedSession) { |
4636 if (GetParam() < kProtoSPDY31) | 4636 if (GetParam() < kProtoSPDY31) |
4637 return; | 4637 return; |
4638 | 4638 |
4639 const char kStreamUrl[] = "http://www.example.org/"; | 4639 const char kStreamUrl[] = "http://www.example.org/"; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4733 | 4733 |
4734 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate1.WaitForClose()); | 4734 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate1.WaitForClose()); |
4735 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate2.WaitForClose()); | 4735 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate2.WaitForClose()); |
4736 | 4736 |
4737 EXPECT_TRUE(delegate1.send_headers_completed()); | 4737 EXPECT_TRUE(delegate1.send_headers_completed()); |
4738 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); | 4738 EXPECT_EQ(std::string(), delegate1.TakeReceivedData()); |
4739 | 4739 |
4740 EXPECT_TRUE(delegate2.send_headers_completed()); | 4740 EXPECT_TRUE(delegate2.send_headers_completed()); |
4741 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); | 4741 EXPECT_EQ(std::string(), delegate2.TakeReceivedData()); |
4742 | 4742 |
4743 EXPECT_TRUE(data.AllWriteDataConsumed()); | 4743 EXPECT_TRUE(data.at_write_eof()); |
4744 } | 4744 } |
4745 | 4745 |
4746 TEST_P(SpdySessionTest, GoAwayOnSessionFlowControlError) { | 4746 TEST_P(SpdySessionTest, GoAwayOnSessionFlowControlError) { |
4747 if (GetParam() < kProtoSPDY31) | 4747 if (GetParam() < kProtoSPDY31) |
4748 return; | 4748 return; |
4749 | 4749 |
4750 MockConnect connect_data(SYNCHRONOUS, OK); | 4750 MockConnect connect_data(SYNCHRONOUS, OK); |
4751 | 4751 |
4752 scoped_ptr<SpdyFrame> req( | 4752 scoped_ptr<SpdyFrame> req( |
4753 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 4753 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5346 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), | 5346 ssl_info.cert = ImportCertFromFile(GetTestCertsDirectory(), |
5347 "spdy_pooling.pem"); | 5347 "spdy_pooling.pem"); |
5348 ssl_info.is_issued_by_known_root = true; | 5348 ssl_info.is_issued_by_known_root = true; |
5349 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); | 5349 ssl_info.public_key_hashes.push_back(test::GetTestHashValue(primary_pin)); |
5350 | 5350 |
5351 EXPECT_TRUE(SpdySession::CanPool( | 5351 EXPECT_TRUE(SpdySession::CanPool( |
5352 &tss, ssl_info, "www.example.org", "mail.example.org")); | 5352 &tss, ssl_info, "www.example.org", "mail.example.org")); |
5353 } | 5353 } |
5354 | 5354 |
5355 } // namespace net | 5355 } // namespace net |
OLD | NEW |