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

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

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage Created 4 years 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_config.cc ('k') | net/quic/core/quic_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_config_test.cc
diff --git a/net/quic/core/quic_config_test.cc b/net/quic/core/quic_config_test.cc
index 890c3ac186bebb58eeeee00314e0350401a2b5c8..9cf0f334df850c5a290b89494d9ca165a5373fcf 100644
--- a/net/quic/core/quic_config_test.cc
+++ b/net/quic/core/quic_config_test.cc
@@ -7,7 +7,7 @@
#include "net/quic/core/crypto/crypto_handshake_message.h"
#include "net/quic/core/crypto/crypto_protocol.h"
#include "net/quic/core/quic_flags.h"
-#include "net/quic/core/quic_protocol.h"
+#include "net/quic/core/quic_packets.h"
#include "net/quic/core/quic_time.h"
#include "net/quic/core/quic_utils.h"
#include "net/quic/test_tools/quic_config_peer.h"
@@ -252,6 +252,56 @@ TEST_F(QuicConfigTest, HasClientSentConnectionOption) {
config_.HasClientSentConnectionOption(kTBBR, Perspective::IS_SERVER));
}
+TEST_F(QuicConfigTest, DontSendClientConnectionOptions) {
+ QuicConfig client_config;
+ QuicTagVector copt;
+ copt.push_back(kTBBR);
+ client_config.SetClientConnectionOptions(copt);
+
+ CryptoHandshakeMessage msg;
+ client_config.ToHandshakeMessage(&msg);
+
+ string error_details;
+ const QuicErrorCode error =
+ config_.ProcessPeerHello(msg, CLIENT, &error_details);
+ EXPECT_EQ(QUIC_NO_ERROR, error);
+ EXPECT_TRUE(config_.negotiated());
+
+ EXPECT_FALSE(config_.HasReceivedConnectionOptions());
+}
+
+TEST_F(QuicConfigTest, HasClientRequestedIndependentOption) {
+ QuicConfig client_config;
+ QuicTagVector client_opt;
+ client_opt.push_back(kRENO);
+ QuicTagVector copt;
+ copt.push_back(kTBBR);
+ client_config.SetClientConnectionOptions(client_opt);
+ client_config.SetConnectionOptionsToSend(copt);
+ EXPECT_TRUE(client_config.HasClientSentConnectionOption(
+ kTBBR, Perspective::IS_CLIENT));
+ EXPECT_TRUE(client_config.HasClientRequestedIndependentOption(
+ kRENO, Perspective::IS_CLIENT));
+ EXPECT_FALSE(client_config.HasClientRequestedIndependentOption(
+ kTBBR, Perspective::IS_CLIENT));
+
+ CryptoHandshakeMessage msg;
+ client_config.ToHandshakeMessage(&msg);
+
+ string error_details;
+ const QuicErrorCode error =
+ config_.ProcessPeerHello(msg, CLIENT, &error_details);
+ EXPECT_EQ(QUIC_NO_ERROR, error);
+ EXPECT_TRUE(config_.negotiated());
+
+ EXPECT_TRUE(config_.HasReceivedConnectionOptions());
+ EXPECT_EQ(1u, config_.ReceivedConnectionOptions().size());
+ EXPECT_FALSE(config_.HasClientRequestedIndependentOption(
+ kRENO, Perspective::IS_SERVER));
+ EXPECT_TRUE(config_.HasClientRequestedIndependentOption(
+ kTBBR, Perspective::IS_SERVER));
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/core/quic_config.cc ('k') | net/quic/core/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698