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

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

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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/crypto/crypto_handshake.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_handshake_test.cc
diff --git a/net/quic/crypto/crypto_handshake_test.cc b/net/quic/crypto/crypto_handshake_test.cc
index 7ff0b1f6d1fe5251bbbcd827e10d1ebae13d9b13..f3d86a59e1cdb2dc8d6d374db331ebb2b051c860 100644
--- a/net/quic/crypto/crypto_handshake_test.cc
+++ b/net/quic/crypto/crypto_handshake_test.cc
@@ -21,18 +21,17 @@ namespace test {
class QuicCryptoServerConfigPeer {
public:
explicit QuicCryptoServerConfigPeer(QuicCryptoServerConfig* server_config)
- : server_config_(server_config) {
- }
+ : server_config_(server_config) {}
string NewSourceAddressToken(IPEndPoint ip,
QuicRandom* rand,
- QuicTime::Delta now) {
+ QuicWallTime now) {
return server_config_->NewSourceAddressToken(ip, rand, now);
}
bool ValidateSourceAddressToken(StringPiece srct,
IPEndPoint ip,
- QuicTime::Delta now) {
+ QuicWallTime now) {
return server_config_->ValidateSourceAddressToken(srct, ip, now);
}
@@ -46,7 +45,8 @@ TEST(QuicCryptoServerConfigTest, ServerConfig) {
CryptoHandshakeMessage extra_tags;
scoped_ptr<CryptoHandshakeMessage>(
- server.AddDefaultConfig(QuicRandom::GetInstance(), &clock, extra_tags));
+ server.AddDefaultConfig(QuicRandom::GetInstance(), &clock, extra_tags,
+ QuicCryptoServerConfig::kDefaultExpiry));
}
TEST(QuicCryptoServerConfigTest, SourceAddressTokens) {
@@ -63,10 +63,11 @@ TEST(QuicCryptoServerConfigTest, SourceAddressTokens) {
IPEndPoint ip6 = IPEndPoint(ip, 2);
QuicRandom* rand = QuicRandom::GetInstance();
MockClock clock;
+ clock.AdvanceTime(QuicTime::Delta::FromSeconds(1000000));
QuicCryptoServerConfigPeer peer(&server);
- QuicTime::Delta now = clock.NowAsDeltaSinceUnixEpoch();
- const QuicTime::Delta original_time = now;
+ QuicWallTime now = clock.WallNow();
+ const QuicWallTime original_time = now;
const string token4 = peer.NewSourceAddressToken(ip4, rand, now);
const string token6 = peer.NewSourceAddressToken(ip6, rand, now);
« no previous file with comments | « net/quic/crypto/crypto_handshake.cc ('k') | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698