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

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

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 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/test_tools/quic_test_utils.h ('k') | net/tools/quic/chlo_extractor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_test_utils.cc
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 1514f2d28df230b3172c9e548d0ac19b704b78d8..28f7115655eae9d509833704728d52c6d4a95558 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -117,6 +117,22 @@ uint64_t SimpleRandom::RandUint64() {
return seed_;
}
+void SimpleRandom::RandBytes(void* data, size_t len) {
+ uint8_t* real_data = static_cast<uint8_t*>(data);
+ for (size_t offset = 0; offset < len; offset++) {
+ real_data[offset] = RandUint64() & 0xff;
+ }
+}
+
+void SimpleRandom::Reseed(const void* additional_entropy, size_t len) {
+ const uint8_t* real_entropy = static_cast<const uint8_t*>(additional_entropy);
+ for (size_t offset = 0; offset < len; offset++) {
+ // Note: this is not actually a well-established way to incorporate new
+ // entropy, but good enough for tests.
+ seed_ *= real_entropy[len];
+ }
+}
+
MockFramerVisitor::MockFramerVisitor() {
// By default, we want to accept packets.
ON_CALL(*this, OnProtocolVersionMismatch(_))
@@ -418,7 +434,7 @@ TestQuicSpdyServerSession::CreateQuicCryptoServerStream(
QuicCompressedCertsCache* compressed_certs_cache) {
return new QuicCryptoServerStream(crypto_config, compressed_certs_cache,
FLAGS_enable_quic_stateless_reject_support,
- this);
+ this, &helper_);
}
QuicCryptoServerStream* TestQuicSpdyServerSession::GetCryptoStream() {
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/chlo_extractor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698