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

Unified Diff: net/quic/core/quic_protocol_test.cc

Issue 2236973002: Landing Recent QUIC changes until 4AM, Aug 7, 2016 UTC-4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: flip quic_sequencer_buffer_retire_block_in_time to true Created 4 years, 4 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
« no previous file with comments | « net/quic/core/quic_protocol.cc ('k') | net/quic/core/quic_received_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_protocol_test.cc
diff --git a/net/quic/core/quic_protocol_test.cc b/net/quic/core/quic_protocol_test.cc
index 0626bfd055ca365644ce3263eeeedb47ea52437f..deee2839823534ca887a92545e808644752ee809 100644
--- a/net/quic/core/quic_protocol_test.cc
+++ b/net/quic/core/quic_protocol_test.cc
@@ -289,7 +289,7 @@ TEST(QuicProtocolTest, FilterSupportedVersions) {
QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36};
FLAGS_quic_enable_version_35 = false;
- FLAGS_quic_enable_version_36 = false;
+ FLAGS_quic_enable_version_36_v2 = false;
QuicVersionVector filtered_versions = FilterSupportedVersions(all_versions);
ASSERT_EQ(5u, filtered_versions.size());
@@ -302,18 +302,32 @@ TEST(QuicProtocolTest, FilterSupportedVersions) {
TEST(QuicProtocolTest, QuicVersionManager) {
FLAGS_quic_enable_version_35 = false;
- FLAGS_quic_enable_version_36 = false;
- QuicVersionManager manager(QuicSupportedVersions());
- EXPECT_EQ(FilterSupportedVersions(QuicSupportedVersions()),
+ FLAGS_quic_enable_version_36_v2 = false;
+ QuicVersionManager manager(AllSupportedVersions());
+ EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
manager.GetSupportedVersions());
FLAGS_quic_enable_version_35 = true;
- FLAGS_quic_enable_version_36 = true;
- EXPECT_EQ(FilterSupportedVersions(QuicSupportedVersions()),
+ FLAGS_quic_enable_version_36_v2 = true;
+ EXPECT_EQ(FilterSupportedVersions(AllSupportedVersions()),
manager.GetSupportedVersions());
EXPECT_EQ(QUIC_VERSION_36, manager.GetSupportedVersions()[0]);
EXPECT_EQ(QUIC_VERSION_35, manager.GetSupportedVersions()[1]);
}
+TEST(QuicProtocolTest, LookUpVersionByIndex) {
+ QuicVersionVector all_versions = {
+ QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33,
+ QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36};
+ int version_count = all_versions.size();
+ for (int i = -5; i <= version_count + 1; ++i) {
+ if (i >= 0 && i < version_count) {
+ EXPECT_EQ(all_versions[i], VersionOfIndex(all_versions, i)[0]);
+ } else {
+ EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, VersionOfIndex(all_versions, i)[0]);
+ }
+ }
+}
+
// Tests that a queue contains the expected data after calls to Add().
TEST(PacketNumberQueueTest, AddRange) {
PacketNumberQueue queue;
« no previous file with comments | « net/quic/core/quic_protocol.cc ('k') | net/quic/core/quic_received_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698