Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Side by Side Diff: net/quic/quic_network_transaction_unittest.cc

Issue 1904833002: Ignore invalid error code in QuicFramer when process GoAway, ConnectionClose, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119529330
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698