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

Unified Diff: net/quic/crypto/quic_crypto_client_config_test.cc

Issue 342863005: QUIC - Record reject reasons for CHLO message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: separated histograms.xml changes into a separate CL Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/crypto/quic_crypto_client_config_test.cc
diff --git a/net/quic/crypto/quic_crypto_client_config_test.cc b/net/quic/crypto/quic_crypto_client_config_test.cc
index fdce91c1fc7a6566ebdbfd5500fee141b160e4f3..63b7859b7c99a05505bf536e1c1d8ced64086b19 100644
--- a/net/quic/crypto/quic_crypto_client_config_test.cc
+++ b/net/quic/crypto/quic_crypto_client_config_test.cc
@@ -255,5 +255,37 @@ TEST(QuicCryptoClientConfigTest, ClearCachedStates) {
EXPECT_EQ(2u, cleared_cache->generation_counter());
}
+TEST(QuicCryptoClientConfigTest, RejectReasonToPackedError) {
+ QuicCryptoClientConfig config;
+ EXPECT_EQ(0u, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(0)));
+ EXPECT_EQ(1u << 5, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(100)));
+ EXPECT_EQ(2u << 5, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(101)));
+ EXPECT_EQ(1u << 10, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(200)));
+ EXPECT_EQ(2u << 10, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(201)));
+ EXPECT_EQ(3u << 10, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(202)));
+ EXPECT_EQ(1u << 15, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(300)));
+ EXPECT_EQ(2u << 15, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(301)));
+ EXPECT_EQ(1u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(400)));
+ EXPECT_EQ(2u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(401)));
+ EXPECT_EQ(3u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(402)));
+ EXPECT_EQ(4u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(403)));
+ EXPECT_EQ(5u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(404)));
+ EXPECT_EQ(6u << 20, config.RejectReasonToPackedError(
+ static_cast<HandshakeFailureReason>(405)));
+}
+
} // namespace test
} // namespace net
« net/quic/crypto/quic_crypto_client_config.cc ('K') | « net/quic/crypto/quic_crypto_client_config.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698