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

Unified Diff: net/quic/test_tools/crypto_test_utils.cc

Issue 192583004: QUIC - use QuicSessionKey tuple (host, port, is_https) instead of server_hostname (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with TOT Created 6 years, 9 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/test_tools/crypto_test_utils.cc
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index 2dbae1efedfcc798d36bb77af17ddfecc6ed39f8..86b22e14057569d417d3ae5859ed50536ecc4879 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -15,6 +15,7 @@
#include "net/quic/quic_crypto_client_stream.h"
#include "net/quic/quic_crypto_server_stream.h"
#include "net/quic/quic_crypto_stream.h"
+#include "net/quic/quic_session_key.h"
#include "net/quic/test_tools/quic_connection_peer.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/quic/test_tools/simple_quic_framer.h"
@@ -30,6 +31,9 @@ namespace test {
namespace {
+const char kServerHostname[] = "test.example.com";
+const uint16 kServerPort = 80;
+
// CryptoFramerVisitor is a framer visitor that records handshake messages.
class CryptoFramerVisitor : public CryptoFramerVisitorInterface {
public:
@@ -175,8 +179,8 @@ int CryptoTestUtils::HandshakeWithFakeClient(
if (options.channel_id_enabled) {
crypto_config.SetChannelIDSigner(ChannelIDSignerForTesting());
}
- QuicCryptoClientStream client("test.example.com", &client_session,
- &crypto_config);
+ QuicSessionKey server_key(kServerHostname, kServerPort, false);
+ QuicCryptoClientStream client(server_key, &client_session, &crypto_config);
client_session.SetCryptoStream(&client);
CHECK(client.CryptoConnect());
@@ -188,7 +192,7 @@ int CryptoTestUtils::HandshakeWithFakeClient(
if (options.channel_id_enabled) {
EXPECT_EQ(crypto_config.channel_id_signer()->GetKeyForHostname(
- "test.example.com"),
+ kServerHostname),
server->crypto_negotiated_params().channel_id);
}

Powered by Google App Engine
This is Rietveld 408576698