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, SPDYNOSSL), | 723 SpdyNetworkTransactionTestParams(kProtoSPDY4, SPDYNOSSL), |
730 SpdyNetworkTransactionTestParams(kProtoSPDY4, SPDYSSL), | 724 SpdyNetworkTransactionTestParams(kProtoSPDY4, SPDYSSL), |
731 SpdyNetworkTransactionTestParams(kProtoSPDY4, SPDYNPN))); | 725 SpdyNetworkTransactionTestParams(kProtoSPDY4, SPDYNPN))); |
732 | 726 |
733 // Verify HttpNetworkTransaction constructor. | 727 // Verify HttpNetworkTransaction constructor. |
734 TEST_P(SpdyNetworkTransactionTest, Constructor) { | 728 TEST_P(SpdyNetworkTransactionTest, Constructor) { |
735 scoped_ptr<SpdySessionDependencies> session_deps( | 729 scoped_ptr<SpdySessionDependencies> session_deps( |
(...skipping 5096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5832 // enough number of WINDOW_UPDATEs to finish the first read and cause a | 5826 // enough number of WINDOW_UPDATEs to finish the first read and cause a |
5833 // write, leading to a complete write of request body; after that we send | 5827 // write, leading to a complete write of request body; after that we send |
5834 // a reply with a body, to cause a graceful shutdown. | 5828 // a reply with a body, to cause a graceful shutdown. |
5835 | 5829 |
5836 // TODO(agayev): develop a socket data provider where both, reads and | 5830 // TODO(agayev): develop a socket data provider where both, reads and |
5837 // writes are ordered so that writing tests like these are easy and rewrite | 5831 // writes are ordered so that writing tests like these are easy and rewrite |
5838 // all these tests using it. Right now we are working around the | 5832 // all these tests using it. Right now we are working around the |
5839 // limitations as described above and it's not deterministic, tests may | 5833 // limitations as described above and it's not deterministic, tests may |
5840 // fail under specific circumstances. | 5834 // fail under specific circumstances. |
5841 TEST_P(SpdyNetworkTransactionTest, WindowUpdateReceived) { | 5835 TEST_P(SpdyNetworkTransactionTest, WindowUpdateReceived) { |
5842 if (GetParam().protocol < kProtoSPDY3) | |
5843 return; | |
5844 | |
5845 static int kFrameCount = 2; | 5836 static int kFrameCount = 2; |
5846 scoped_ptr<std::string> content( | 5837 scoped_ptr<std::string> content( |
5847 new std::string(kMaxSpdyFrameChunkSize, 'a')); | 5838 new std::string(kMaxSpdyFrameChunkSize, 'a')); |
5848 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( | 5839 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( |
5849 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); | 5840 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); |
5850 scoped_ptr<SpdyFrame> body( | 5841 scoped_ptr<SpdyFrame> body( |
5851 spdy_util_.ConstructSpdyBodyFrame( | 5842 spdy_util_.ConstructSpdyBodyFrame( |
5852 1, content->c_str(), content->size(), false)); | 5843 1, content->c_str(), content->size(), false)); |
5853 scoped_ptr<SpdyFrame> body_end( | 5844 scoped_ptr<SpdyFrame> body_end( |
5854 spdy_util_.ConstructSpdyBodyFrame( | 5845 spdy_util_.ConstructSpdyBodyFrame( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5923 | 5914 |
5924 rv = callback.WaitForResult(); | 5915 rv = callback.WaitForResult(); |
5925 EXPECT_EQ(OK, rv); | 5916 EXPECT_EQ(OK, rv); |
5926 | 5917 |
5927 helper.VerifyDataConsumed(); | 5918 helper.VerifyDataConsumed(); |
5928 } | 5919 } |
5929 | 5920 |
5930 // Test that received data frames and sent WINDOW_UPDATE frames change | 5921 // Test that received data frames and sent WINDOW_UPDATE frames change |
5931 // the recv_window_size_ correctly. | 5922 // the recv_window_size_ correctly. |
5932 TEST_P(SpdyNetworkTransactionTest, WindowUpdateSent) { | 5923 TEST_P(SpdyNetworkTransactionTest, WindowUpdateSent) { |
5933 if (GetParam().protocol < kProtoSPDY3) | |
5934 return; | |
5935 | |
5936 // Amount of body required to trigger a sent window update. | 5924 // Amount of body required to trigger a sent window update. |
5937 const size_t kTargetSize = kSpdyStreamInitialWindowSize / 2 + 1; | 5925 const size_t kTargetSize = kSpdyStreamInitialWindowSize / 2 + 1; |
5938 | 5926 |
5939 scoped_ptr<SpdyFrame> req( | 5927 scoped_ptr<SpdyFrame> req( |
5940 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); | 5928 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); |
5941 scoped_ptr<SpdyFrame> session_window_update( | 5929 scoped_ptr<SpdyFrame> session_window_update( |
5942 spdy_util_.ConstructSpdyWindowUpdate(0, kTargetSize)); | 5930 spdy_util_.ConstructSpdyWindowUpdate(0, kTargetSize)); |
5943 scoped_ptr<SpdyFrame> window_update( | 5931 scoped_ptr<SpdyFrame> window_update( |
5944 spdy_util_.ConstructSpdyWindowUpdate(1, kTargetSize)); | 5932 spdy_util_.ConstructSpdyWindowUpdate(1, kTargetSize)); |
5945 | 5933 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6005 stream->stream()->recv_window_size()); | 5993 stream->stream()->recv_window_size()); |
6006 EXPECT_THAT(base::StringPiece(buf->data(), kTargetSize), Each(Eq('x'))); | 5994 EXPECT_THAT(base::StringPiece(buf->data(), kTargetSize), Each(Eq('x'))); |
6007 | 5995 |
6008 // Allow scheduled WINDOW_UPDATE frames to write. | 5996 // Allow scheduled WINDOW_UPDATE frames to write. |
6009 base::RunLoop().RunUntilIdle(); | 5997 base::RunLoop().RunUntilIdle(); |
6010 helper.VerifyDataConsumed(); | 5998 helper.VerifyDataConsumed(); |
6011 } | 5999 } |
6012 | 6000 |
6013 // Test that WINDOW_UPDATE frame causing overflow is handled correctly. | 6001 // Test that WINDOW_UPDATE frame causing overflow is handled correctly. |
6014 TEST_P(SpdyNetworkTransactionTest, WindowUpdateOverflow) { | 6002 TEST_P(SpdyNetworkTransactionTest, WindowUpdateOverflow) { |
6015 if (GetParam().protocol < kProtoSPDY3) | |
6016 return; | |
6017 | |
6018 // Number of full frames we hope to write (but will not, used to | 6003 // Number of full frames we hope to write (but will not, used to |
6019 // set content-length header correctly) | 6004 // set content-length header correctly) |
6020 static int kFrameCount = 3; | 6005 static int kFrameCount = 3; |
6021 | 6006 |
6022 scoped_ptr<std::string> content( | 6007 scoped_ptr<std::string> content( |
6023 new std::string(kMaxSpdyFrameChunkSize, 'a')); | 6008 new std::string(kMaxSpdyFrameChunkSize, 'a')); |
6024 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( | 6009 scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyPost( |
6025 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); | 6010 kRequestUrl, 1, kMaxSpdyFrameChunkSize * kFrameCount, LOWEST, NULL, 0)); |
6026 scoped_ptr<SpdyFrame> body( | 6011 scoped_ptr<SpdyFrame> body( |
6027 spdy_util_.ConstructSpdyBodyFrame( | 6012 spdy_util_.ConstructSpdyBodyFrame( |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6087 // also contains a FIN flag. DelayedSocketData is used to enforce all | 6072 // also contains a FIN flag. DelayedSocketData is used to enforce all |
6088 // writes go through before a read could happen. However, the last frame | 6073 // writes go through before a read could happen. However, the last frame |
6089 // ("hello!") is not supposed to go through since by the time its turn | 6074 // ("hello!") is not supposed to go through since by the time its turn |
6090 // arrives, window size is 0. At this point MessageLoop::Run() called via | 6075 // arrives, window size is 0. At this point MessageLoop::Run() called via |
6091 // callback would block. Therefore we call MessageLoop::RunUntilIdle() | 6076 // callback would block. Therefore we call MessageLoop::RunUntilIdle() |
6092 // which returns after performing all possible writes. We use DCHECKS to | 6077 // which returns after performing all possible writes. We use DCHECKS to |
6093 // ensure that last data frame is still there and stream has stalled. | 6078 // ensure that last data frame is still there and stream has stalled. |
6094 // After that, next read is artifically enforced, which causes a | 6079 // After that, next read is artifically enforced, which causes a |
6095 // WINDOW_UPDATE to be read and I/O process resumes. | 6080 // WINDOW_UPDATE to be read and I/O process resumes. |
6096 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResume) { | 6081 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResume) { |
6097 if (GetParam().protocol < kProtoSPDY3) | |
6098 return; | |
6099 | |
6100 // Number of frames we need to send to zero out the window size: data | 6082 // Number of frames we need to send to zero out the window size: data |
6101 // frames plus SYN_STREAM plus the last data frame; also we need another | 6083 // frames plus SYN_STREAM plus the last data frame; also we need another |
6102 // data frame that we will send once the WINDOW_UPDATE is received, | 6084 // data frame that we will send once the WINDOW_UPDATE is received, |
6103 // therefore +3. | 6085 // therefore +3. |
6104 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6086 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6105 | 6087 |
6106 // Calculate last frame's size; 0 size data frame is legal. | 6088 // Calculate last frame's size; 0 size data frame is legal. |
6107 size_t last_frame_size = | 6089 size_t last_frame_size = |
6108 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6090 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6109 | 6091 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6201 EXPECT_TRUE(stream->stream()->send_stalled_by_flow_control()); | 6183 EXPECT_TRUE(stream->stream()->send_stalled_by_flow_control()); |
6202 | 6184 |
6203 data.ForceNextRead(); // Read in WINDOW_UPDATE frame. | 6185 data.ForceNextRead(); // Read in WINDOW_UPDATE frame. |
6204 rv = callback.WaitForResult(); | 6186 rv = callback.WaitForResult(); |
6205 helper.VerifyDataConsumed(); | 6187 helper.VerifyDataConsumed(); |
6206 } | 6188 } |
6207 | 6189 |
6208 // Test we correctly handle the case where the SETTINGS frame results in | 6190 // Test we correctly handle the case where the SETTINGS frame results in |
6209 // unstalling the send window. | 6191 // unstalling the send window. |
6210 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings) { | 6192 TEST_P(SpdyNetworkTransactionTest, FlowControlStallResumeAfterSettings) { |
6211 if (GetParam().protocol < kProtoSPDY3) | |
6212 return; | |
6213 | |
6214 // Number of frames we need to send to zero out the window size: data | 6193 // Number of frames we need to send to zero out the window size: data |
6215 // frames plus SYN_STREAM plus the last data frame; also we need another | 6194 // frames plus SYN_STREAM plus the last data frame; also we need another |
6216 // data frame that we will send once the SETTING is received, therefore +3. | 6195 // data frame that we will send once the SETTING is received, therefore +3. |
6217 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6196 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6218 | 6197 |
6219 // Calculate last frame's size; 0 size data frame is legal. | 6198 // Calculate last frame's size; 0 size data frame is legal. |
6220 size_t last_frame_size = | 6199 size_t last_frame_size = |
6221 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6200 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6222 | 6201 |
6223 // Construct content for a data frame of maximum size. | 6202 // Construct content for a data frame of maximum size. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6322 data.RunFor(7); // Read in SETTINGS frame to unstall. | 6301 data.RunFor(7); // Read in SETTINGS frame to unstall. |
6323 rv = callback.WaitForResult(); | 6302 rv = callback.WaitForResult(); |
6324 helper.VerifyDataConsumed(); | 6303 helper.VerifyDataConsumed(); |
6325 // If stream is NULL, that means it was unstalled and closed. | 6304 // If stream is NULL, that means it was unstalled and closed. |
6326 EXPECT_TRUE(stream->stream() == NULL); | 6305 EXPECT_TRUE(stream->stream() == NULL); |
6327 } | 6306 } |
6328 | 6307 |
6329 // Test we correctly handle the case where the SETTINGS frame results in a | 6308 // Test we correctly handle the case where the SETTINGS frame results in a |
6330 // negative send window size. | 6309 // negative send window size. |
6331 TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) { | 6310 TEST_P(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) { |
6332 if (GetParam().protocol < kProtoSPDY3) | |
6333 return; | |
6334 | |
6335 // Number of frames we need to send to zero out the window size: data | 6311 // Number of frames we need to send to zero out the window size: data |
6336 // frames plus SYN_STREAM plus the last data frame; also we need another | 6312 // frames plus SYN_STREAM plus the last data frame; also we need another |
6337 // data frame that we will send once the SETTING is received, therefore +3. | 6313 // data frame that we will send once the SETTING is received, therefore +3. |
6338 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; | 6314 size_t num_writes = kSpdyStreamInitialWindowSize / kMaxSpdyFrameChunkSize + 3; |
6339 | 6315 |
6340 // Calculate last frame's size; 0 size data frame is legal. | 6316 // Calculate last frame's size; 0 size data frame is legal. |
6341 size_t last_frame_size = | 6317 size_t last_frame_size = |
6342 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; | 6318 kSpdyStreamInitialWindowSize % kMaxSpdyFrameChunkSize; |
6343 | 6319 |
6344 // Construct content for a data frame of maximum size. | 6320 // Construct content for a data frame of maximum size. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6379 scoped_ptr<SpdyFrame> settings_frame_small( | 6355 scoped_ptr<SpdyFrame> settings_frame_small( |
6380 spdy_util_.ConstructSpdySettings(new_settings)); | 6356 spdy_util_.ConstructSpdySettings(new_settings)); |
6381 // Construct read frames for WINDOW_UPDATE that makes the send_window_size | 6357 // Construct read frames for WINDOW_UPDATE that makes the send_window_size |
6382 // positive. | 6358 // positive. |
6383 scoped_ptr<SpdyFrame> session_window_update_init_size( | 6359 scoped_ptr<SpdyFrame> session_window_update_init_size( |
6384 spdy_util_.ConstructSpdyWindowUpdate(0, kSpdyStreamInitialWindowSize)); | 6360 spdy_util_.ConstructSpdyWindowUpdate(0, kSpdyStreamInitialWindowSize)); |
6385 scoped_ptr<SpdyFrame> window_update_init_size( | 6361 scoped_ptr<SpdyFrame> window_update_init_size( |
6386 spdy_util_.ConstructSpdyWindowUpdate(1, kSpdyStreamInitialWindowSize)); | 6362 spdy_util_.ConstructSpdyWindowUpdate(1, kSpdyStreamInitialWindowSize)); |
6387 | 6363 |
6388 reads.push_back(CreateMockRead(*settings_frame_small, i++)); | 6364 reads.push_back(CreateMockRead(*settings_frame_small, i++)); |
6389 | 6365 reads.push_back(CreateMockRead(*session_window_update_init_size, i++)); |
6390 if (GetParam().protocol >= kProtoSPDY3) | |
6391 reads.push_back(CreateMockRead(*session_window_update_init_size, i++)); | |
6392 | |
6393 reads.push_back(CreateMockRead(*window_update_init_size, i++)); | 6366 reads.push_back(CreateMockRead(*window_update_init_size, i++)); |
6394 | 6367 |
6395 scoped_ptr<SpdyFrame> settings_ack(spdy_util_.ConstructSpdySettingsAck()); | 6368 scoped_ptr<SpdyFrame> settings_ack(spdy_util_.ConstructSpdySettingsAck()); |
6396 writes.push_back(CreateMockWrite(*settings_ack, i++)); | 6369 writes.push_back(CreateMockWrite(*settings_ack, i++)); |
6397 | 6370 |
6398 writes.push_back(CreateMockWrite(*body3, i++)); | 6371 writes.push_back(CreateMockWrite(*body3, i++)); |
6399 | 6372 |
6400 scoped_ptr<SpdyFrame> reply(spdy_util_.ConstructSpdyPostSynReply(NULL, 0)); | 6373 scoped_ptr<SpdyFrame> reply(spdy_util_.ConstructSpdyPostSynReply(NULL, 0)); |
6401 reads.push_back(CreateMockRead(*reply, i++)); | 6374 reads.push_back(CreateMockRead(*reply, i++)); |
6402 reads.push_back(CreateMockRead(*body2, i++)); | 6375 reads.push_back(CreateMockRead(*body2, i++)); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6546 | 6519 |
6547 //----------------------------------------------------------------------------- | 6520 //----------------------------------------------------------------------------- |
6548 // All tests are run with three different connection types: SPDY after NPN | 6521 // All tests are run with three different connection types: SPDY after NPN |
6549 // negotiation, SPDY without SSL, and SPDY with SSL. | 6522 // negotiation, SPDY without SSL, and SPDY with SSL. |
6550 // | 6523 // |
6551 // TODO(akalin): Use ::testing::Combine() when we are able to use | 6524 // TODO(akalin): Use ::testing::Combine() when we are able to use |
6552 // <tr1/tuple>. | 6525 // <tr1/tuple>. |
6553 INSTANTIATE_TEST_CASE_P( | 6526 INSTANTIATE_TEST_CASE_P( |
6554 Spdy, | 6527 Spdy, |
6555 SpdyNetworkTransactionNoTLSUsageCheckTest, | 6528 SpdyNetworkTransactionNoTLSUsageCheckTest, |
6556 ::testing::Values(SpdyNetworkTransactionTestParams(kProtoDeprecatedSPDY2, | 6529 ::testing::Values(SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN))); |
6557 SPDYNPN), | |
6558 SpdyNetworkTransactionTestParams(kProtoSPDY3, SPDYNPN), | |
6559 SpdyNetworkTransactionTestParams(kProtoSPDY31, SPDYNPN))); | |
6560 | 6530 |
6561 TEST_P(SpdyNetworkTransactionNoTLSUsageCheckTest, TLSVersionTooOld) { | 6531 TEST_P(SpdyNetworkTransactionNoTLSUsageCheckTest, TLSVersionTooOld) { |
6562 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6532 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6563 new SSLSocketDataProvider(ASYNC, OK)); | 6533 new SSLSocketDataProvider(ASYNC, OK)); |
6564 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_SSL3, | 6534 SSLConnectionStatusSetVersion(SSL_CONNECTION_VERSION_SSL3, |
6565 &ssl_provider->connection_status); | 6535 &ssl_provider->connection_status); |
6566 | 6536 |
6567 RunNoTLSUsageCheckTest(ssl_provider.Pass()); | 6537 RunNoTLSUsageCheckTest(ssl_provider.Pass()); |
6568 } | 6538 } |
6569 | 6539 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6613 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6583 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
6614 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6584 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6615 new SSLSocketDataProvider(ASYNC, OK)); | 6585 new SSLSocketDataProvider(ASYNC, OK)); |
6616 // Set to TLS_RSA_WITH_NULL_MD5 | 6586 // Set to TLS_RSA_WITH_NULL_MD5 |
6617 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6587 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
6618 | 6588 |
6619 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6589 RunTLSUsageCheckTest(ssl_provider.Pass()); |
6620 } | 6590 } |
6621 | 6591 |
6622 } // namespace net | 6592 } // namespace net |
OLD | NEW |