| 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 <cmath> | 5 #include <cmath> |
| 6 #include <memory> | 6 #include <memory> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2903 HttpResponseInfo response = *trans->GetResponseInfo(); | 2903 HttpResponseInfo response = *trans->GetResponseInfo(); |
| 2904 EXPECT_TRUE(response.headers); | 2904 EXPECT_TRUE(response.headers); |
| 2905 EXPECT_EQ("HTTP/1.1 200", response.headers->GetStatusLine()); | 2905 EXPECT_EQ("HTTP/1.1 200", response.headers->GetStatusLine()); |
| 2906 } | 2906 } |
| 2907 | 2907 |
| 2908 TEST_F(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID9) { | 2908 TEST_F(SpdyNetworkTransactionTest, ServerPushInvalidAssociatedStreamID9) { |
| 2909 SpdySerializedFrame stream1_syn( | 2909 SpdySerializedFrame stream1_syn( |
| 2910 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); | 2910 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); |
| 2911 SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); | 2911 SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); |
| 2912 SpdySerializedFrame stream2_rst( | 2912 SpdySerializedFrame stream2_rst( |
| 2913 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); | 2913 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_STREAM_CLOSED)); |
| 2914 MockWrite writes[] = { | 2914 MockWrite writes[] = { |
| 2915 CreateMockWrite(stream1_syn, 0), CreateMockWrite(stream2_rst, 3), | 2915 CreateMockWrite(stream1_syn, 0), CreateMockWrite(stream2_rst, 3), |
| 2916 }; | 2916 }; |
| 2917 | 2917 |
| 2918 SpdySerializedFrame stream1_reply( | 2918 SpdySerializedFrame stream1_reply( |
| 2919 spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); | 2919 spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); |
| 2920 SpdySerializedFrame stream2_syn(spdy_util_.ConstructSpdyPush( | 2920 SpdySerializedFrame stream2_syn(spdy_util_.ConstructSpdyPush( |
| 2921 nullptr, 0, 2, 9, GetDefaultUrlWithPath("/foo.dat").c_str())); | 2921 nullptr, 0, 2, 9, GetDefaultUrlWithPath("/foo.dat").c_str())); |
| 2922 MockRead reads[] = { | 2922 MockRead reads[] = { |
| 2923 CreateMockRead(stream1_reply, 1), CreateMockRead(stream2_syn, 2), | 2923 CreateMockRead(stream1_reply, 1), CreateMockRead(stream2_syn, 2), |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3036 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, | 3036 NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, |
| 3037 NetLogWithSource(), nullptr); | 3037 NetLogWithSource(), nullptr); |
| 3038 helper.RunToCompletion(&data); | 3038 helper.RunToCompletion(&data); |
| 3039 } | 3039 } |
| 3040 | 3040 |
| 3041 // PUSH_PROMISE on a closed client-initiated stream should trigger RST_STREAM. | 3041 // PUSH_PROMISE on a closed client-initiated stream should trigger RST_STREAM. |
| 3042 TEST_F(SpdyNetworkTransactionTest, ServerPushOnClosedStream) { | 3042 TEST_F(SpdyNetworkTransactionTest, ServerPushOnClosedStream) { |
| 3043 SpdySerializedFrame stream1_syn( | 3043 SpdySerializedFrame stream1_syn( |
| 3044 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); | 3044 spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); |
| 3045 SpdySerializedFrame rst( | 3045 SpdySerializedFrame rst( |
| 3046 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_INVALID_STREAM)); | 3046 spdy_util_.ConstructSpdyRstStream(2, RST_STREAM_STREAM_CLOSED)); |
| 3047 MockWrite writes[] = { | 3047 MockWrite writes[] = { |
| 3048 CreateMockWrite(stream1_syn, 0), CreateMockWrite(rst, 5), | 3048 CreateMockWrite(stream1_syn, 0), CreateMockWrite(rst, 5), |
| 3049 }; | 3049 }; |
| 3050 | 3050 |
| 3051 SpdySerializedFrame stream1_reply( | 3051 SpdySerializedFrame stream1_reply( |
| 3052 spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); | 3052 spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); |
| 3053 SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); | 3053 SpdySerializedFrame stream1_body(spdy_util_.ConstructSpdyDataFrame(1, true)); |
| 3054 SpdySerializedFrame stream2_syn(spdy_util_.ConstructSpdyPush( | 3054 SpdySerializedFrame stream2_syn(spdy_util_.ConstructSpdyPush( |
| 3055 nullptr, 0, 2, 1, GetDefaultUrlWithPath("/foo.dat").c_str())); | 3055 nullptr, 0, 2, 1, GetDefaultUrlWithPath("/foo.dat").c_str())); |
| 3056 MockRead reads[] = { | 3056 MockRead reads[] = { |
| (...skipping 3409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6466 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6466 TEST_F(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6467 std::unique_ptr<SSLSocketDataProvider> ssl_provider( | 6467 std::unique_ptr<SSLSocketDataProvider> ssl_provider( |
| 6468 new SSLSocketDataProvider(ASYNC, OK)); | 6468 new SSLSocketDataProvider(ASYNC, OK)); |
| 6469 // Set to TLS_RSA_WITH_NULL_MD5 | 6469 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6470 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6470 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6471 | 6471 |
| 6472 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6472 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6473 } | 6473 } |
| 6474 | 6474 |
| 6475 } // namespace net | 6475 } // namespace net |
| OLD | NEW |