gfe-relnote: (n/a) Platformize logging for http2. Refactor only, no behavior change.
Note on merge: http2/platform/impl/http2_logging_impl.h also needs to be merged to Chromium.
PiperOrigin-RevId: 237381363
Change-Id: I98a69eaeca7ac1353054120681e18e99a73c63c4
diff --git a/http2/decoder/payload_decoders/headers_payload_decoder_test.cc b/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
index cb58b8e..a7a90bf 100644
--- a/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
+++ b/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
@@ -6,12 +6,12 @@
#include <stddef.h>
-#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
@@ -47,44 +47,44 @@
// via the public methods of FramePartsCollector.
struct Listener : public FramePartsCollector {
void OnHeadersStart(const Http2FrameHeader& header) override {
- VLOG(1) << "OnHeadersStart: " << header;
+ HTTP2_VLOG(1) << "OnHeadersStart: " << header;
StartFrame(header)->OnHeadersStart(header);
}
void OnHeadersPriority(const Http2PriorityFields& priority) override {
- VLOG(1) << "OnHeadersPriority: " << priority;
+ HTTP2_VLOG(1) << "OnHeadersPriority: " << priority;
CurrentFrame()->OnHeadersPriority(priority);
}
void OnHpackFragment(const char* data, size_t len) override {
- VLOG(1) << "OnHpackFragment: len=" << len;
+ HTTP2_VLOG(1) << "OnHpackFragment: len=" << len;
CurrentFrame()->OnHpackFragment(data, len);
}
void OnHeadersEnd() override {
- VLOG(1) << "OnHeadersEnd";
+ HTTP2_VLOG(1) << "OnHeadersEnd";
EndFrame()->OnHeadersEnd();
}
void OnPadLength(size_t pad_length) override {
- VLOG(1) << "OnPadLength: " << pad_length;
+ HTTP2_VLOG(1) << "OnPadLength: " << pad_length;
CurrentFrame()->OnPadLength(pad_length);
}
void OnPadding(const char* padding, size_t skipped_length) override {
- VLOG(1) << "OnPadding: " << skipped_length;
+ HTTP2_VLOG(1) << "OnPadding: " << skipped_length;
CurrentFrame()->OnPadding(padding, skipped_length);
}
void OnPaddingTooLong(const Http2FrameHeader& header,
size_t missing_length) override {
- VLOG(1) << "OnPaddingTooLong: " << header
- << "; missing_length: " << missing_length;
+ HTTP2_VLOG(1) << "OnPaddingTooLong: " << header
+ << "; missing_length: " << missing_length;
FrameError(header)->OnPaddingTooLong(header, missing_length);
}
void OnFrameSizeError(const Http2FrameHeader& header) override {
- VLOG(1) << "OnFrameSizeError: " << header;
+ HTTP2_VLOG(1) << "OnFrameSizeError: " << header;
FrameError(header)->OnFrameSizeError(header);
}
};
@@ -94,14 +94,16 @@
HeadersPayloadDecoderPeer,
Listener> {};
-INSTANTIATE_TEST_SUITE_P(VariousPadLengths, HeadersPayloadDecoderTest,
+INSTANTIATE_TEST_SUITE_P(VariousPadLengths,
+ HeadersPayloadDecoderTest,
::testing::Values(0, 1, 2, 3, 4, 254, 255, 256));
// Decode various sizes of (fake) HPACK payload, both with and without the
// PRIORITY flag set.
TEST_P(HeadersPayloadDecoderTest, VariousHpackPayloadSizes) {
for (size_t hpack_size : {0, 1, 2, 3, 255, 256, 1024}) {
- LOG(INFO) << "########### hpack_size = " << hpack_size << " ###########";
+ HTTP2_LOG(INFO) << "########### hpack_size = " << hpack_size
+ << " ###########";
Http2PriorityFields priority(RandStreamId(), 1 + Random().Rand8(),
Random().OneIn(2));