| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2023 NetErrorDetails details; | 2023 NetErrorDetails details; |
| 2024 EXPECT_EQ(QUIC_NO_ERROR, details.quic_connection_error); | 2024 EXPECT_EQ(QUIC_NO_ERROR, details.quic_connection_error); |
| 2025 | 2025 |
| 2026 trans->PopulateNetErrorDetails(&details); | 2026 trans->PopulateNetErrorDetails(&details); |
| 2027 // Verify the error code logged is what sent by the peer. | 2027 // Verify the error code logged is what sent by the peer. |
| 2028 EXPECT_EQ(QUIC_CRYPTO_VERSION_NOT_SUPPORTED, details.quic_connection_error); | 2028 EXPECT_EQ(QUIC_CRYPTO_VERSION_NOT_SUPPORTED, details.quic_connection_error); |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 TEST_P(QuicNetworkTransactionTest, | 2031 TEST_P(QuicNetworkTransactionTest, |
| 2032 LogGranularQuicErrorCodeOnQuicProtocolErrorRemote) { | 2032 LogGranularQuicErrorCodeOnQuicProtocolErrorRemote) { |
| 2033 ValueRestore<bool> old_flag(&FLAGS_quic_ignore_invalid_error_code, false); |
| 2033 MockQuicData mock_quic_data; | 2034 MockQuicData mock_quic_data; |
| 2034 mock_quic_data.AddWrite( | 2035 mock_quic_data.AddWrite( |
| 2035 ConstructRequestHeadersPacket(1, kClientDataStreamId1, true, true, | 2036 ConstructRequestHeadersPacket(1, kClientDataStreamId1, true, true, |
| 2036 GetRequestHeaders("GET", "https", "/"))); | 2037 GetRequestHeaders("GET", "https", "/"))); |
| 2037 // Peer sending an invalid stream frame with a invalid stream error causes | 2038 // Peer sending an invalid stream frame with a invalid stream error causes |
| 2038 // this end to raise error and close connection. | 2039 // this end to raise error and close connection. |
| 2039 mock_quic_data.AddRead(ConstructRstPacket(1, false, kClientDataStreamId1, | 2040 mock_quic_data.AddRead(ConstructRstPacket(1, false, kClientDataStreamId1, |
| 2040 QUIC_STREAM_LAST_ERROR)); | 2041 QUIC_STREAM_LAST_ERROR)); |
| 2041 std::string quic_error_details = "Invalid rst stream error code."; | 2042 std::string quic_error_details = "Invalid rst stream error code."; |
| 2042 mock_quic_data.AddWrite(ConstructAckAndConnectionClosePacket( | 2043 mock_quic_data.AddWrite(ConstructAckAndConnectionClosePacket( |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2347 std::unique_ptr<HttpNetworkTransaction> trans( | 2348 std::unique_ptr<HttpNetworkTransaction> trans( |
| 2348 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); | 2349 new HttpNetworkTransaction(DEFAULT_PRIORITY, session_.get())); |
| 2349 TestCompletionCallback callback; | 2350 TestCompletionCallback callback; |
| 2350 int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); | 2351 int rv = trans->Start(&request_, callback.callback(), net_log_.bound()); |
| 2351 EXPECT_EQ(ERR_IO_PENDING, rv); | 2352 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 2352 EXPECT_NE(OK, callback.WaitForResult()); | 2353 EXPECT_NE(OK, callback.WaitForResult()); |
| 2353 } | 2354 } |
| 2354 | 2355 |
| 2355 } // namespace test | 2356 } // namespace test |
| 2356 } // namespace net | 2357 } // namespace net |
| OLD | NEW |