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

Unified Diff: net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc

Issue 2572343002: Use std::function instead of base::Callback in net/http2/. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
Index: net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
diff --git a/net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc b/net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
index ba1a815adfdb1257c70b782edf1a57a0465d7691..f7d8383650bbd74f6fad3a564ac9fbeace80cdf0 100644
--- a/net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
+++ b/net/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "base/bind.h"
#include "base/logging.h"
#include "net/http2/decoder/frame_parts.h"
#include "net/http2/decoder/frame_parts_collector.h"
@@ -96,10 +95,6 @@ class PushPromisePayloadDecoderTest
: public AbstractPaddablePayloadDecoderTest<PushPromisePayloadDecoder,
PushPromisePayloadDecoderPeer,
Listener> {
- public:
- static bool ApproveSizeForTruncated(size_t size) {
- return size != Http2PushPromiseFields::EncodedSize();
- }
};
INSTANTIATE_TEST_CASE_P(VariousPadLengths,
@@ -131,13 +126,14 @@ TEST_P(PushPromisePayloadDecoderTest, VariousHpackPayloadSizes) {
// Confirm we get an error if the payload is not long enough for the required
// portion of the payload, regardless of the amount of (valid) padding.
TEST_P(PushPromisePayloadDecoderTest, Truncated) {
+ auto approve_size = [](size_t size) {
+ return size != Http2PushPromiseFields::EncodedSize();
+ };
Http2PushPromiseFields push_promise{RandStreamId()};
Http2FrameBuilder fb;
fb.Append(push_promise);
- EXPECT_TRUE(VerifyDetectsMultipleFrameSizeErrors(
- 0, fb.buffer(),
- base::Bind(&PushPromisePayloadDecoderTest::ApproveSizeForTruncated),
- total_pad_length_));
+ EXPECT_TRUE(VerifyDetectsMultipleFrameSizeErrors(0, fb.buffer(), approve_size,
+ total_pad_length_));
}
// Confirm we get an error if the PADDED flag is set but the payload is not

Powered by Google App Engine
This is Rietveld 408576698