Commit c47bd31d authored by zhongyi's avatar zhongyi Committed by Commit bot

Move kDeprecatedQuicErrorCode and kActiveQuicErrorCode to domain_reliability to keep

quic_protocol.h clean of chromium only code.

BUG=

Review-Url: https://codereview.chromium.org/2028803002
Cr-Commit-Position: refs/heads/master@{#396939}
parent bb48cb54
......@@ -235,7 +235,13 @@ const struct QuicErrorMapping {
{ net::QUIC_LAST_ERROR, "quic.last_error"}
};
static_assert(arraysize(kQuicErrorMap) == net::kActiveQuicErrorCount,
// Must be updated any time a net::QuicErrorCode is deprecated in
// net/quic/quic_protocol.h.
const int kDeprecatedQuicErrorCount = 4;
const int kActiveQuicErrorCount =
net::QUIC_LAST_ERROR - kDeprecatedQuicErrorCount;
static_assert(arraysize(kQuicErrorMap) == kActiveQuicErrorCount,
"quic_error_map is not in sync with quic protocol!");
} // namespace
......
......@@ -696,10 +696,6 @@ enum QuicErrorCode {
QUIC_LAST_ERROR = 91,
};
// Must be updated any time a QuicErrorCode is deprecated.
const int kDeprecatedQuicErrorCount = 4;
const int kActiveQuicErrorCount = QUIC_LAST_ERROR - kDeprecatedQuicErrorCount;
typedef char DiversificationNonce[32];
struct NET_EXPORT_PRIVATE QuicPacketPublicHeader {
......
......@@ -67,20 +67,6 @@ TEST(QuicProtocolTest, IsAawaitingPacket) {
EXPECT_TRUE(IsAwaitingPacket(ack_frame2, 50u, 20u));
}
TEST(QuicProtocolTest, QuicDeprecatedErrorCodeCount) {
// If you deprecated any QuicErrorCode, you will need to update the
// deprecated QuicErrorCode count. Otherwise this test will fail.
int num_deprecated_errors = 0;
std::string invalid_error_code = "INVALID_ERROR_CODE";
for (int i = 0; i < QUIC_LAST_ERROR; ++i) {
if (QuicUtils::ErrorToString(static_cast<QuicErrorCode>(i)) ==
invalid_error_code) {
++num_deprecated_errors;
}
}
EXPECT_EQ(kDeprecatedQuicErrorCount, num_deprecated_errors);
}
TEST(QuicProtocolTest, QuicVersionToQuicTag) {
// If you add a new version to the QuicVersion enum you will need to add a new
// case to QuicVersionToQuicTag, otherwise this test will fail.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment