Unify gfe2::RecordingHeadersHandler and spdy::TestHeadersHandler to spdy::RecordingHeadersHandler.
This CL extracts spdy::TestHeadersHandler into its own file and renames to
spdy::RecordingHeadersHandler. Then gfe2::RecordingHeadersHandler is nixed in
favor of spdy::RecordingHeadersHandler. This is a clean-up in its own right.
This CL is also a prefactor for forking http2_trace_logging.{h,cc} to
shinkansen_trace_logging.{h,cc}. It aims to reduce the content in
http2_trace_logging.{h,cc}, to reduce the content to fork.
PiperOrigin-RevId: 341693359
Change-Id: I00740b20a4e95dca9f612fe8a4dc155814a7b84f
diff --git a/quic/core/http/quic_headers_stream_test.cc b/quic/core/http/quic_headers_stream_test.cc
index 44ed080..8f604b3 100644
--- a/quic/core/http/quic_headers_stream_test.cc
+++ b/quic/core/http/quic_headers_stream_test.cc
@@ -28,11 +28,13 @@
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
using spdy::ERROR_CODE_PROTOCOL_ERROR;
+using spdy::RecordingHeadersHandler;
using spdy::SETTINGS_ENABLE_PUSH;
using spdy::SETTINGS_HEADER_TABLE_SIZE;
using spdy::SETTINGS_INITIAL_WINDOW_SIZE;
@@ -60,7 +62,6 @@
using spdy::SpdySettingsIR;
using spdy::SpdyStreamId;
using spdy::SpdyWindowUpdateIR;
-using spdy::test::TestHeadersHandler;
using testing::_;
using testing::AnyNumber;
using testing::AtLeast;
@@ -294,7 +295,7 @@
}
void SaveToHandler(size_t size, const QuicHeaderList& header_list) {
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
headers_handler_->OnHeaderBlockStart();
for (const auto& p : header_list) {
headers_handler_->OnHeader(p.first, p.second);
@@ -339,7 +340,7 @@
/*parent_stream_id=*/0,
/*exclusive=*/false, fin, kFrameComplete));
}
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id))
.WillOnce(Return(headers_handler_.get()));
EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1);
@@ -390,7 +391,7 @@
StrictMock<MockQuicSpdySession> session_;
QuicHeadersStream* headers_stream_;
SpdyHeaderBlock headers_;
- std::unique_ptr<TestHeadersHandler> headers_handler_;
+ std::unique_ptr<RecordingHeadersHandler> headers_handler_;
std::string body_;
std::string saved_data_;
std::string saved_header_data_;
@@ -449,7 +450,7 @@
// Parse the outgoing data and check that it matches was was written.
EXPECT_CALL(visitor_,
OnPushPromise(stream_id, promised_stream_id, kFrameComplete));
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id))
.WillOnce(Return(headers_handler_.get()));
EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1);