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

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

Issue 2572343002: Use std::function instead of base::Callback in net/http2/. (Closed)
Patch Set: Remove unreachable return statements. Created 4 years 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/rst_stream_payload_decoder_test.cc
diff --git a/net/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc b/net/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
index 703d98ffa31c0117f5ce5dcc6d6285ff1c5652b9..88bd80366dcc6e1fce134f8a4628df70f4ee5bb3 100644
--- a/net/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
+++ b/net/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "base/bind.h"
#include "base/logging.h"
#include "net/http2/decoder/frame_parts.h"
#include "net/http2/decoder/frame_parts_collector.h"
@@ -58,11 +57,6 @@ class RstStreamPayloadDecoderTest
: public AbstractPayloadDecoderTest<RstStreamPayloadDecoder,
RstStreamPayloadDecoderPeer,
Listener> {
- public:
- static bool ApproveSizeForWrongSize(size_t size) {
- return size != Http2RstStreamFields::EncodedSize();
- }
-
protected:
Http2RstStreamFields RandRstStreamFields() {
Http2RstStreamFields fields;
@@ -74,13 +68,14 @@ class RstStreamPayloadDecoderTest
// Confirm we get an error if the payload is not the correct size to hold
// exactly one Http2RstStreamFields.
TEST_F(RstStreamPayloadDecoderTest, WrongSize) {
+ auto approve_size = [](size_t size) {
+ return size != Http2RstStreamFields::EncodedSize();
+ };
Http2FrameBuilder fb;
fb.Append(RandRstStreamFields());
fb.Append(RandRstStreamFields());
fb.Append(RandRstStreamFields());
- EXPECT_TRUE(VerifyDetectsFrameSizeError(
- 0, fb.buffer(),
- base::Bind(&RstStreamPayloadDecoderTest::ApproveSizeForWrongSize)));
+ EXPECT_TRUE(VerifyDetectsFrameSizeError(0, fb.buffer(), approve_size));
}
TEST_F(RstStreamPayloadDecoderTest, AllErrors) {

Powered by Google App Engine
This is Rietveld 408576698