Clean up QuicPacketCreatorTest.
gfe-relnote: n/a. test only.
PiperOrigin-RevId: 276096857
Change-Id: I34982aac4a59e4270834eace35aee1223c086283
diff --git a/quic/core/frames/quic_stream_frame.cc b/quic/core/frames/quic_stream_frame.cc
index b9413c7..c7626d3 100644
--- a/quic/core/frames/quic_stream_frame.cc
+++ b/quic/core/frames/quic_stream_frame.cc
@@ -43,4 +43,10 @@
return os;
}
+bool QuicStreamFrame::operator==(const QuicStreamFrame& rhs) const {
+ return fin == rhs.fin && data_length == rhs.data_length &&
+ stream_id == rhs.stream_id && data_buffer == rhs.data_buffer &&
+ offset == rhs.offset;
+}
+
} // namespace quic
diff --git a/quic/core/frames/quic_stream_frame.h b/quic/core/frames/quic_stream_frame.h
index 6cd510d..5e7439d 100644
--- a/quic/core/frames/quic_stream_frame.h
+++ b/quic/core/frames/quic_stream_frame.h
@@ -31,6 +31,8 @@
friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
const QuicStreamFrame& s);
+ bool operator==(const QuicStreamFrame& rhs) const;
+
bool fin;
QuicPacketLength data_length;
QuicStreamId stream_id;
diff --git a/quic/core/quic_packet_creator_test.cc b/quic/core/quic_packet_creator_test.cc
index c342235..063a906 100644
--- a/quic/core/quic_packet_creator_test.cc
+++ b/quic/core/quic_packet_creator_test.cc
@@ -2028,16 +2028,13 @@
MakeIOVector("coalesce", &iov_);
// frame will be coalesced with the first frame.
const auto previous_size = creator_.PacketSize();
- EXPECT_CALL(debug, OnStreamFrameCoalesced(_));
+ QuicStreamFrame target(stream_id1, true, 0, 12);
+ EXPECT_CALL(debug, OnStreamFrameCoalesced(target));
ASSERT_TRUE(creator_.ConsumeDataToFillCurrentPacket(
stream_id1, &iov_, 1u, iov_.iov_len, 0u, 4u, true, false,
NOT_RETRANSMISSION, &frame));
EXPECT_EQ(frame.stream_frame.data_length,
creator_.PacketSize() - previous_size);
- auto queued_frames = QuicPacketCreatorPeer::GetQueuedFrames(&creator_);
- EXPECT_EQ(1u, queued_frames.size());
- EXPECT_EQ(12u, queued_frames.front().stream_frame.data_length);
- EXPECT_TRUE(queued_frames.front().stream_frame.fin);
// frame is for another stream, so it won't be coalesced.
const auto length = creator_.BytesFree() - 10u;
diff --git a/quic/test_tools/quic_packet_creator_peer.cc b/quic/test_tools/quic_packet_creator_peer.cc
index 8ffd59f..be934fd 100644
--- a/quic/test_tools/quic_packet_creator_peer.cc
+++ b/quic/test_tools/quic_packet_creator_peer.cc
@@ -58,12 +58,6 @@
return creator->GetLengthLength();
}
-// static
-const QuicFrames& QuicPacketCreatorPeer::GetQueuedFrames(
- QuicPacketCreator* creator) {
- return creator->queued_frames_;
-}
-
void QuicPacketCreatorPeer::SetPacketNumber(QuicPacketCreator* creator,
uint64_t s) {
DCHECK_NE(0u, s);
diff --git a/quic/test_tools/quic_packet_creator_peer.h b/quic/test_tools/quic_packet_creator_peer.h
index 3948aa4..88587a2 100644
--- a/quic/test_tools/quic_packet_creator_peer.h
+++ b/quic/test_tools/quic_packet_creator_peer.h
@@ -26,7 +26,6 @@
QuicPacketNumberLength packet_number_length);
static QuicPacketNumberLength GetPacketNumberLength(
QuicPacketCreator* creator);
- static const QuicFrames& GetQueuedFrames(QuicPacketCreator* creator);
static QuicVariableLengthIntegerLength GetRetryTokenLengthLength(
QuicPacketCreator* creator);
static QuicVariableLengthIntegerLength GetLengthLength(