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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const char kRequestUrl[] = "http://www.google.com/"; | 51 const char kRequestUrl[] = "http://www.google.com/"; |
52 | 52 |
53 enum SpdyNetworkTransactionTestSSLType { | 53 enum SpdyNetworkTransactionTestSSLType { |
54 SPDYNPN, | 54 SPDYNPN, |
55 SPDYNOSSL, | 55 SPDYNOSSL, |
56 SPDYSSL, | 56 SPDYSSL, |
57 }; | 57 }; |
58 | 58 |
59 struct SpdyNetworkTransactionTestParams { | 59 struct SpdyNetworkTransactionTestParams { |
60 SpdyNetworkTransactionTestParams() | 60 SpdyNetworkTransactionTestParams() |
61 : protocol(kProtoSPDY3), | 61 : protocol(kProtoSPDY31), |
62 ssl_type(SPDYNPN) {} | 62 ssl_type(SPDYNPN) {} |
63 | 63 |
64 SpdyNetworkTransactionTestParams( | 64 SpdyNetworkTransactionTestParams( |
65 NextProto protocol, | 65 NextProto protocol, |
66 SpdyNetworkTransactionTestSSLType ssl_type) | 66 SpdyNetworkTransactionTestSSLType ssl_type) |
67 : protocol(protocol), | 67 : protocol(protocol), |
68 ssl_type(ssl_type) {} | 68 ssl_type(ssl_type) {} |
69 | 69 |
70 NextProto protocol; | 70 NextProto protocol; |
71 SpdyNetworkTransactionTestSSLType ssl_type; | 71 SpdyNetworkTransactionTestSSLType ssl_type; |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 //----------------------------------------------------------------------------- | 710 //----------------------------------------------------------------------------- |
711 // All tests are run with three different connection types: SPDY after NPN | 711 // All tests are run with three different connection types: SPDY after NPN |
712 // negotiation, SPDY without SSL, and SPDY with SSL. | 712 // negotiation, SPDY without SSL, and SPDY with SSL. |
713 // | 713 // |
714 // TODO(akalin): Use ::testing::Combine() when we are able to use | 714 // TODO(akalin): Use ::testing::Combine() when we are able to use |
715 // <tr1/tuple>. | 715 // <tr1/tuple>. |
716 INSTANTIATE_TEST_CASE_P( | 716 INSTANTIATE_TEST_CASE_P( |
717 Spdy, | 717 Spdy, |
718 SpdyNetworkTransactionTest, | 718 SpdyNetworkTransactionTest, |
719 ::testing::Values( | 719 ::testing::Values( |
720 SpdyNetworkTransactionTestParams(kProtoDeprecatedSPDY2, SPDYNOSSL), | |
721 SpdyNetworkTransactionTestParams(kProtoDeprecatedSPDY2, SPDYSSL), | |
722 SpdyNetworkTransactionTestParams(kProtoDeprecatedSPDY2, SPDYNPN), | |
723 SpdyNetworkTransactionTestParams(kProtoSPDY3, SPDYNOSSL), | |
724 SpdyNetworkTransactionTestParams(kProtoSPDY3, SPDYSSL), | |
725 SpdyNetworkTransactionTestParams(kProtoSPDY3, SPDYNPN), | |
726 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNOSSL), | 720 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNOSSL), |
727 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYSSL), | 721 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYSSL), |
728 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN), | 722 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN), |
729 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYNOSSL), | 723 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYNOSSL), |
730 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYSSL), | 724 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYSSL), |
731 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYNPN), | 725 SpdyNetworkTransactionTestParams(kProtoSPDY4_14, SPDYNPN), |
732 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYNOSSL), | 726 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYNOSSL), |
733 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYSSL), | 727 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYSSL), |
734 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYNPN))); | 728 SpdyNetworkTransactionTestParams(kProtoSPDY4_15, SPDYNPN))); |
735 | 729 |
(...skipping 5100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5836 // enough number of WINDOW_UPDATEs to finish the first read and cause a | 5830 // enough number of WINDOW_UPDATEs to finish the first read and cause a |
5837 // write, leading to a complete write of request body; after that we send | 5831 // write, leading to a complete write of request body; after that we send |
5838 // a reply with a body, to cause a graceful shutdown. | 5832 // a reply with a body, to cause a graceful shutdown. |
5839 | 5833 |
5840 // TODO(agayev): develop a socket data provider where both, reads and | 5834 // TODO(agayev): develop a socket data provider where both, reads and |
5841 // writes are ordered so that writing tests like these are easy and rewrite | 5835 // writes are ordered so that writing tests like these are easy and rewrite |
5842 // all these tests using it. Right now we are working around the | 5836 // all these tests using it. Right now we are working around the |
5843 // limitations as described above and it's not deterministic, tests may | 5837 // limitations as described above and it's not deterministic, tests may |
5844 // fail under specific circumstances. | 5838 // fail under specific circumstances. |
5845 TEST_P(SpdyNetworkTransactionTest, WindowUpdateReceived) { | 5839 TEST_P(SpdyNetworkTransactionTest, WindowUpdateReceived) { |
5846 if (GetParam().protocol < kProtoSPDY3) | |
5847 return; | |
5848 | |
5849 static int kFrameCount = 2; | 5840 static int kFrameCount = 2; |
5850 scoped_ptr<std::string> content( | 5841 scoped_ptr<std::string> content( |
5851 new std::string(kMaxSpdyFrameChunkSize, 'a')); | 5842 new std::string(kMaxSpdyFrameChunkSize, 'a')); |
5852 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( | 5843 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( |
5853 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); | 5844 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); |
5854 scoped_ptr<SpdyFrame> body( | 5845 scoped_ptr<SpdyFrame> body( |
5855 spdy_util_.ConstructSpdyBodyFrame( | 5846 spdy_util_.ConstructSpdyBodyFrame( |
5856 1, content->c_str(), content->size(), false)); | 5847 1, content->c_str(), content->size(), false)); |
5857 scoped_ptr<SpdyFrame> body_end( | 5848 scoped_ptr<SpdyFrame> body_end( |
5858 spdy_util_.ConstructSpdyBodyFrame( | 5849 spdy_util_.ConstructSpdyBodyFrame( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5927 | 5918 |
5928 rv = callback.WaitForResult(); | 5919 rv = callback.WaitForResult(); |
5929 EXPECT_EQ(OK, rv); | 5920 EXPECT_EQ(OK, rv); |
5930 | 5921 |
5931 helper.VerifyDataConsumed(); | 5922 helper.VerifyDataConsumed(); |
5932 } | 5923 } |
5933 | 5924 |
5934 // Test that received data frames and sent WINDOW_UPDATE frames change | 5925 // Test that received data frames and sent WINDOW_UPDATE frames change |
5935 // the recv_window_size_ correctly. | 5926 // the recv_window_size_ correctly. |
5936 TEST_P(SpdyNetworkTransactionTest, WindowUpdateSent) { | 5927 TEST_P(SpdyNetworkTransactionTest, WindowUpdateSent) { |
5937 if (GetParam().protocol < kProtoSPDY3) | |
5938 return; | |
5939 | |
5940 // Amount of body required to trigger a sent window update. | 5928 // Amount of body required to trigger a sent window update. |
5941 const size_t kTargetSize = kSpdyStreamInitialWindowSize / 2 + 1; | 5929 const size_t kTargetSize = kSpdyStreamInitialWindowSize / 2 + 1; |
5942 | 5930 |
5943 scoped_ptr<SpdyFrame> req( | 5931 scoped_ptr<SpdyFrame> req( |
5944 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 5932 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
5945 scoped_ptr<SpdyFrame> session_window_update( | 5933 scoped_ptr<SpdyFrame> session_window_update( |
5946 spdy_util_.ConstructSpdyWindowUpdate(0, kTargetSize)); | 5934 spdy_util_.ConstructSpdyWindowUpdate(0, kTargetSize)); |
5947 scoped_ptr<SpdyFrame> window_update( | 5935 scoped_ptr<SpdyFrame> window_update( |
5948 spdy_util_.ConstructSpdyWindowUpdate(1, kTargetSize)); | 5936 spdy_util_.ConstructSpdyWindowUpdate(1, kTargetSize)); |
5949 | 5937 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6009 stream->stream()->recv_window_size()); | 5997 stream->stream()->recv_window_size()); |
6010 EXPECT_THAT(base::StringPiece(buf->data(), kTargetSize), Each(Eq('x'))); | 5998 EXPECT_THAT(base::StringPiece(buf->data(), kTargetSize), Each(Eq('x'))); |
6011 | 5999 |
6012 // Allow scheduled WINDOW_UPDATE frames to write. | 6000 // Allow scheduled WINDOW_UPDATE frames to write. |
6013 base::RunLoop().RunUntilIdle(); | 6001 base::RunLoop().RunUntilIdle(); |
6014 helper.VerifyDataConsumed(); | 6002 helper.VerifyDataConsumed(); |
6015 } | 6003 } |
6016 | 6004 |
6017 // Test that WINDOW_UPDATE frame causing overflow is handled correctly. | 6005 // Test that WINDOW_UPDATE frame causing overflow is handled correctly. |
6018 TEST_P(SpdyNetworkTransactionTest, WindowUpdateOverflow) { | 6006 TEST_P(SpdyNetworkTransactionTest, WindowUpdateOverflow) { |
6019 if (GetParam().protocol < kProtoSPDY3) | |
6020 return; | |
6021 | |
6022 // Number of full frames we hope to write (but will not, used to | 6007 // Number of full frames we hope to write (but will not, used to |
6023 // set content-length header correctly) | 6008 // set content-length header correctly) |
6024 static int kFrameCount = 3; | 6009 static int kFrameCount = 3; |
6025 | 6010 |
6026 scoped_ptr<std::string> content( | 6011 scoped_ptr<std::string> content( |
6027 new std::string(kMaxSpdyFrameChunkSize, 'a')); | 6012 new std::string(kMaxSpdyFrameChunkSize, 'a')); |
6028 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( | 6013 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( |
6029 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); | 6014 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); |
6030 scoped_ptr<SpdyFrame> body( | 6015 scoped_ptr<SpdyFrame> body( |
6031 spdy_util_.ConstructSpdyBodyFrame( | 6016 spdy_util_.ConstructSpdyBodyFrame( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6091 // also contains a FIN flag. DelayedSocketData is used to enforce all | 6076 // also contains a FIN flag. DelayedSocketData is used to enforce all |
6092 // writes go through before a read could happen. However, the last frame | 6077 // writes go through before a read could happen. However, the last frame |
6093 // ("hello!") is not supposed to go through since by the time its turn | 6078 // ("hello!") is not supposed to go through since by the time its turn |
6094 // arrives, window size is 0. At this point MessageLoop::Run() called via | 6079 // arrives, window size is 0. At this point MessageLoop::Run() called via |
6095 // callback would block. Therefore we call MessageLoop::RunUntilIdle() | 6080 // callback would block. Therefore we call MessageLoop::RunUntilIdle() |
6096 // which returns after performing all possible writes. We use DCHECKS to | 6081 // which returns after performing all possible writes. We use DCHECKS to |
6097 // ensure that last data frame is still there and stream has stalled. | 6082 // ensure that last data frame is still there and stream has stalled. |
6098 // After that, next read is artifically enforced, which causes a | 6083 // After that, next read is artifically enforced, which causes a |
6099 // WINDOW_UPDATE to be read and I/O process resumes. | 6084 // WINDOW_UPDATE to be read and I/O process resumes. |
6100 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResume) { | 6085 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResume) { |
6101 if (GetParam().protocol < kProtoSPDY3) | |
6102 return; | |
6103 | |
6104 // Number of frames we need to send to zero out the window size: data | 6086 // Number of frames we need to send to zero out the window size: data |
6105 // frames plus SYN_STREAM plus the last data frame; also we need another | 6087 // frames plus SYN_STREAM plus the last data frame; also we need another |
6106 // data frame that we will send once the WINDOW_UPDATE is received, | 6088 // data frame that we will send once the WINDOW_UPDATE is received, |
6107 // therefore +3. | 6089 // therefore +3. |
6108 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6090 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6109 | 6091 |
6110 // Calculate last frame's size; 0 size data frame is legal. | 6092 // Calculate last frame's size; 0 size data frame is legal. |
6111 size_t last_frame_size = | 6093 size_t last_frame_size = |
6112 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6094 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6113 | 6095 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6205 EXPECT_TRUE(stream->stream()->send_stalled_by_flow_control()); | 6187 EXPECT_TRUE(stream->stream()->send_stalled_by_flow_control()); |
6206 | 6188 |
6207 data.ForceNextRead(); // Read in WINDOW_UPDATE frame. | 6189 data.ForceNextRead(); // Read in WINDOW_UPDATE frame. |
6208 rv = callback.WaitForResult(); | 6190 rv = callback.WaitForResult(); |
6209 helper.VerifyDataConsumed(); | 6191 helper.VerifyDataConsumed(); |
6210 } | 6192 } |
6211 | 6193 |
6212 // Test we correctly handle the case where the SETTINGS frame results in | 6194 // Test we correctly handle the case where the SETTINGS frame results in |
6213 // unstalling the send window. | 6195 // unstalling the send window. |
6214 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings) { | 6196 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings) { |
6215 if (GetParam().protocol < kProtoSPDY3) | |
6216 return; | |
6217 | |
6218 // Number of frames we need to send to zero out the window size: data | 6197 // Number of frames we need to send to zero out the window size: data |
6219 // frames plus SYN_STREAM plus the last data frame; also we need another | 6198 // frames plus SYN_STREAM plus the last data frame; also we need another |
6220 // data frame that we will send once the SETTING is received, therefore +3. | 6199 // data frame that we will send once the SETTING is received, therefore +3. |
6221 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6200 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6222 | 6201 |
6223 // Calculate last frame's size; 0 size data frame is legal. | 6202 // Calculate last frame's size; 0 size data frame is legal. |
6224 size_t last_frame_size = | 6203 size_t last_frame_size = |
6225 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6204 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6226 | 6205 |
6227 // Construct content for a data frame of maximum size. | 6206 // Construct content for a data frame of maximum size. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6326 data.RunFor(7); // Read in SETTINGS frame to unstall. | 6305 data.RunFor(7); // Read in SETTINGS frame to unstall. |
6327 rv = callback.WaitForResult(); | 6306 rv = callback.WaitForResult(); |
6328 helper.VerifyDataConsumed(); | 6307 helper.VerifyDataConsumed(); |
6329 // If stream is NULL, that means it was unstalled and closed. | 6308 // If stream is NULL, that means it was unstalled and closed. |
6330 EXPECT_TRUE(stream->stream() == NULL); | 6309 EXPECT_TRUE(stream->stream() == NULL); |
6331 } | 6310 } |
6332 | 6311 |
6333 // Test we correctly handle the case where the SETTINGS frame results in a | 6312 // Test we correctly handle the case where the SETTINGS frame results in a |
6334 // negative send window size. | 6313 // negative send window size. |
6335 TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) { | 6314 TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) { |
6336 if (GetParam().protocol < kProtoSPDY3) | |
6337 return; | |
6338 | |
6339 // Number of frames we need to send to zero out the window size: data | 6315 // Number of frames we need to send to zero out the window size: data |
6340 // frames plus SYN_STREAM plus the last data frame; also we need another | 6316 // frames plus SYN_STREAM plus the last data frame; also we need another |
6341 // data frame that we will send once the SETTING is received, therefore +3. | 6317 // data frame that we will send once the SETTING is received, therefore +3. |
6342 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6318 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6343 | 6319 |
6344 // Calculate last frame's size; 0 size data frame is legal. | 6320 // Calculate last frame's size; 0 size data frame is legal. |
6345 size_t last_frame_size = | 6321 size_t last_frame_size = |
6346 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6322 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6347 | 6323 |
6348 // Construct content for a data frame of maximum size. | 6324 // Construct content for a data frame of maximum size. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6383 scoped_ptr<SpdyFrame> settings_frame_small( | 6359 scoped_ptr<SpdyFrame> settings_frame_small( |
6384 spdy_util_.ConstructSpdySettings(new_settings)); | 6360 spdy_util_.ConstructSpdySettings(new_settings)); |
6385 // Construct read frames for WINDOW_UPDATE that makes the send_window_size | 6361 // Construct read frames for WINDOW_UPDATE that makes the send_window_size |
6386 // positive. | 6362 // positive. |
6387 scoped_ptr<SpdyFrame> session_window_update_init_size( | 6363 scoped_ptr<SpdyFrame> session_window_update_init_size( |
6388 spdy_util_.ConstructSpdyWindowUpdate(0, kSpdyStreamInitialWindowSize)); | 6364 spdy_util_.ConstructSpdyWindowUpdate(0, kSpdyStreamInitialWindowSize)); |
6389 scoped_ptr<SpdyFrame> window_update_init_size( | 6365 scoped_ptr<SpdyFrame> window_update_init_size( |
6390 spdy_util_.ConstructSpdyWindowUpdate(1, kSpdyStreamInitialWindowSize)); | 6366 spdy_util_.ConstructSpdyWindowUpdate(1, kSpdyStreamInitialWindowSize)); |
6391 | 6367 |
6392 reads.push_back(CreateMockRead(*settings_frame_small, i++)); | 6368 reads.push_back(CreateMockRead(*settings_frame_small, i++)); |
6393 | 6369 reads.push_back(CreateMockRead(*session_window_update_init_size, i++)); |
6394 if (GetParam().protocol >= kProtoSPDY3) | |
6395 reads.push_back(CreateMockRead(*session_window_update_init_size, i++)); | |
6396 | |
6397 reads.push_back(CreateMockRead(*window_update_init_size, i++)); | 6370 reads.push_back(CreateMockRead(*window_update_init_size, i++)); |
6398 | 6371 |
6399 scoped_ptr<SpdyFrame> settings_ack(spdy_util_.ConstructSpdySettingsAck()); | 6372 scoped_ptr<SpdyFrame> settings_ack(spdy_util_.ConstructSpdySettingsAck()); |
6400 writes.push_back(CreateMockWrite(*settings_ack, i++)); | 6373 writes.push_back(CreateMockWrite(*settings_ack, i++)); |
6401 | 6374 |
6402 writes.push_back(CreateMockWrite(*body3, i++)); | 6375 writes.push_back(CreateMockWrite(*body3, i++)); |
6403 | 6376 |
6404 scoped_ptr<SpdyFrame> reply(spdy_util_.ConstructSpdyPostSynReply(NULL, 0)); | 6377 scoped_ptr<SpdyFrame> reply(spdy_util_.ConstructSpdyPostSynReply(NULL, 0)); |
6405 reads.push_back(CreateMockRead(*reply, i++)); | 6378 reads.push_back(CreateMockRead(*reply, i++)); |
6406 reads.push_back(CreateMockRead(*body2, i++)); | 6379 reads.push_back(CreateMockRead(*body2, i++)); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6550 | 6523 |
6551 //----------------------------------------------------------------------------- | 6524 //----------------------------------------------------------------------------- |
6552 // All tests are run with three different connection types: SPDY after NPN | 6525 // All tests are run with three different connection types: SPDY after NPN |
6553 // negotiation, SPDY without SSL, and SPDY with SSL. | 6526 // negotiation, SPDY without SSL, and SPDY with SSL. |
6554 // | 6527 // |
6555 // TODO(akalin): Use ::testing::Combine() when we are able to use | 6528 // TODO(akalin): Use ::testing::Combine() when we are able to use |
6556 // <tr1/tuple>. | 6529 // <tr1/tuple>. |
6557 INSTANTIATE_TEST_CASE_P( | 6530 INSTANTIATE_TEST_CASE_P( |
6558 Spdy, | 6531 Spdy, |
6559 SpdyNetworkTransactionNoTLSUsageCheckTest, | 6532 SpdyNetworkTransactionNoTLSUsageCheckTest, |
6560 ::testing::Values(SpdyNetworkTransactionTestParams(kProtoDeprecatedSPDY2, | 6533 ::testing::Values(SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN))); |
6561 SPDYNPN), | |
6562 SpdyNetworkTransactionTestParams(kProtoSPDY3, SPDYNPN), | |
6563 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN))); | |
6564 | 6534 |
6565 TEST_P(SpdyNetworkTransactionNoTLSUsageCheckTest, TLSVersionTooOld) { | 6535 TEST_P(SpdyNetworkTransactionNoTLSUsageCheckTest, TLSVersionTooOld) { |
6566 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6536 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6567 new SSLSocketDataProvider(ASYNC, OK)); | 6537 new SSLSocketDataProvider(ASYNC, OK)); |
6568 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_SSL3, | 6538 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_SSL3, |
6569 &ssl_provider->connection_status); | 6539 &ssl_provider->connection_status); |
6570 | 6540 |
6571 RunNoTLSUsageCheckTest(ssl_provider.Pass()); | 6541 RunNoTLSUsageCheckTest(ssl_provider.Pass()); |
6572 } | 6542 } |
6573 | 6543 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6619 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6589 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
6620 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6590 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6621 new SSLSocketDataProvider(ASYNC, OK)); | 6591 new SSLSocketDataProvider(ASYNC, OK)); |
6622 // Set to TLS_RSA_WITH_NULL_MD5 | 6592 // Set to TLS_RSA_WITH_NULL_MD5 |
6623 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6593 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
6624 | 6594 |
6625 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6595 RunTLSUsageCheckTest(ssl_provider.Pass()); |
6626 } | 6596 } |
6627 | 6597 |
6628 } // namespace net | 6598 } // namespace net |
OLD | NEW |