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

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

Issue 2516033003: Landing Recent QUIC changes until Mon Nov 14 04:43:50 2016 +0000 (Closed)
Patch Set: Remove unused UpdatePacketGapSentHistogram() function. Created 4 years, 1 month 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_packet_maker.cc ('k') | net/quic/test_tools/quic_test_utils.cc » ('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.h
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h
index f0773530f924594b8adc5bd48e8cf34e6cf10c4b..58e54ca24c68058884eb16442b0e6096aa229bd6 100644
--- a/net/quic/test_tools/quic_test_utils.h
+++ b/net/quic/test_tools/quic_test_utils.h
@@ -24,6 +24,7 @@
#include "net/quic/core/quic_client_push_promise_index.h"
#include "net/quic/core/quic_connection.h"
#include "net/quic/core/quic_framer.h"
+#include "net/quic/core/quic_iovector.h"
#include "net/quic/core/quic_protocol.h"
#include "net/quic/core/quic_sent_packet_manager_interface.h"
#include "net/quic/core/quic_server_session_base.h"
@@ -189,15 +190,10 @@ QuicConfig DefaultQuicConfigStatelessRejects();
// Returns a version vector consisting of |version|.
QuicVersionVector SupportedVersions(QuicVersion version);
-// Testing convenience method to construct a QuicAckFrame with entropy_hash set
-// to 0 and largest_observed from peer set to |largest_observed|.
+// Testing convenience method to construct a QuicAckFrame with largest_observed
+// from peer set to |largest_observed|.
QuicAckFrame MakeAckFrame(QuicPacketNumber largest_observed);
-// Testing convenience method to construct a QuicAckFrame with |num_nack_ranges|
-// nack ranges of width 1 packet, starting from |least_unacked|.
-QuicAckFrame MakeAckFrameWithNackRanges(size_t num_nack_ranges,
- QuicPacketNumber least_unacked);
-
// Testing convenience method to construct a QuicAckFrame with |num_ack_blocks|
// ack blocks of width 1 packet, starting from |least_unacked| + 2.
QuicAckFrame MakeAckFrameWithAckBlocks(size_t num_ack_blocks,
@@ -811,31 +807,6 @@ class MockLossAlgorithm : public LossDetectionInterface {
DISALLOW_COPY_AND_ASSIGN(MockLossAlgorithm);
};
-class TestEntropyCalculator
- : public QuicReceivedEntropyHashCalculatorInterface {
- public:
- TestEntropyCalculator();
- ~TestEntropyCalculator() override;
-
- QuicPacketEntropyHash EntropyHash(
- QuicPacketNumber packet_number) const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestEntropyCalculator);
-};
-
-class MockEntropyCalculator : public TestEntropyCalculator {
- public:
- MockEntropyCalculator();
- ~MockEntropyCalculator() override;
-
- MOCK_CONST_METHOD1(EntropyHash,
- QuicPacketEntropyHash(QuicPacketNumber packet_number));
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockEntropyCalculator);
-};
-
class MockAckListener : public QuicAckListenerInterface {
public:
MockAckListener();
@@ -1077,6 +1048,15 @@ QuicHeaderList AsHeaderList(const T& container) {
return l;
}
+// Utility function that returns an QuicIOVector object wrapped around |str|.
+// // |str|'s data is stored in |iov|.
+inline QuicIOVector MakeIOVector(base::StringPiece str, struct iovec* iov) {
+ iov->iov_base = const_cast<char*>(str.data());
+ iov->iov_len = static_cast<size_t>(str.size());
+ QuicIOVector quic_iov(iov, 1, str.size());
+ return quic_iov;
+}
+
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/test_tools/quic_test_packet_maker.cc ('k') | net/quic/test_tools/quic_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698