Fix 13 ClangInliner findings:
* The use of this symbol has been deprecated and marked for inlining. The function being deprecated is testing::InvokeWithoutArgs. (13 times)
See go/inliner-lsc for more information on why you've received this change and why it is important.
This CL looks good? Just grant approval!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/inliner-bug for category ClangInliner if there's an issue with the CL content.
* File a bug under go/rosie-bug if there's an issue with how the CL was managed.
* For all other issues such as the formatting of the CL, please file a bug under
go/clrobot-bug.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.
This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/METADATA by
following go/clrobot#how-to-opt-in. Anything wrong with the signup? File a bug
at go/clrobot-bug.
#clrobot #third_party-googletest-googlemock-include-gmock-gmock-actions.h
Tested:
Local presubmit tests passed.
PiperOrigin-RevId: 951879140
diff --git a/quiche/http2/adapter/adapter_impl_comparison_test.cc b/quiche/http2/adapter/adapter_impl_comparison_test.cc
index ac20723..b736cf7 100644
--- a/quiche/http2/adapter/adapter_impl_comparison_test.cc
+++ b/quiche/http2/adapter/adapter_impl_comparison_test.cc
@@ -93,12 +93,11 @@
bool frame_valid = true;
testing::NiceMock<MockHttp2Visitor> visitor;
- ON_CALL(visitor, OnInvalidFrame)
- .WillByDefault(InvokeWithoutArgs([&frame_valid]() {
- // Records that the frame was not valid.
- frame_valid = false;
- return true;
- }));
+ ON_CALL(visitor, OnInvalidFrame).WillByDefault([&frame_valid]() {
+ // Records that the frame was not valid.
+ frame_valid = false;
+ return true;
+ });
for (Impl impl : implementations()) {
frame_valid = true;
diff --git a/quiche/http2/adapter/nghttp2_adapter_test.cc b/quiche/http2/adapter/nghttp2_adapter_test.cc
index 8eaff06..fa2125f 100644
--- a/quiche/http2/adapter/nghttp2_adapter_test.cc
+++ b/quiche/http2/adapter/nghttp2_adapter_test.cc
@@ -1478,9 +1478,9 @@
EXPECT_CALL(visitor,
OnHeaderForStream(1, "date", "Tue, 6 Apr 2021 12:54:01 GMT"))
.WillOnce(testing::DoAll(
- testing::InvokeWithoutArgs([&adapter]() {
+ [&adapter]() {
adapter->SubmitRst(1, Http2ErrorCode::REFUSED_STREAM);
- }),
+ },
testing::Return(OnHeaderResult::HEADER_RST_STREAM)));
const int64_t stream_result = adapter->ProcessBytes(stream_frames);
@@ -3954,10 +3954,10 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/this/is/request/one"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&adapter, kSentinel1]() {
+ .WillOnce([&adapter, kSentinel1]() {
adapter->SetStreamUserData(1, const_cast<char*>(kSentinel1));
return true;
- }));
+ });
EXPECT_CALL(visitor, OnFrameHeader(1, 4, WINDOW_UPDATE, 0));
EXPECT_CALL(visitor, OnWindowUpdate(1, 2000));
EXPECT_CALL(visitor, OnFrameHeader(1, 25, DATA, 0));
@@ -4917,11 +4917,11 @@
EXPECT_CALL(visitor, OnFrameHeader(3, _, kMetadataFrameType, 0));
EXPECT_CALL(visitor, OnBeginMetadataForStream(3, _));
EXPECT_CALL(visitor, OnMetadataForStream(3, "This is the re"))
- .WillOnce(testing::DoAll(testing::InvokeWithoutArgs([&adapter]() {
- adapter->SubmitRst(
- 3, Http2ErrorCode::REFUSED_STREAM);
- }),
- testing::Return(true)));
+ .WillOnce(testing::DoAll(
+ [&adapter]() {
+ adapter->SubmitRst(3, Http2ErrorCode::REFUSED_STREAM);
+ },
+ testing::Return(true)));
// The rest of the metadata is still delivered to the visitor.
EXPECT_CALL(visitor, OnFrameHeader(3, _, kMetadataFrameType, 4));
EXPECT_CALL(visitor, OnBeginMetadataForStream(3, _));
@@ -5401,10 +5401,10 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/this/is/request/one"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&adapter, kSentinel1]() {
+ .WillOnce([&adapter, kSentinel1]() {
adapter->SetStreamUserData(1, const_cast<char*>(kSentinel1));
return true;
- }));
+ });
EXPECT_CALL(visitor, OnEndStream(1));
const int64_t result = adapter->ProcessBytes(frames);
diff --git a/quiche/http2/adapter/oghttp2_adapter_test.cc b/quiche/http2/adapter/oghttp2_adapter_test.cc
index c35e3e5..6faf800 100644
--- a/quiche/http2/adapter/oghttp2_adapter_test.cc
+++ b/quiche/http2/adapter/oghttp2_adapter_test.cc
@@ -1804,9 +1804,9 @@
EXPECT_CALL(visitor,
OnHeaderForStream(1, "date", "Tue, 6 Apr 2021 12:54:01 GMT"))
.WillOnce(testing::DoAll(
- testing::InvokeWithoutArgs([&adapter]() {
+ [&adapter]() {
adapter->SubmitRst(1, Http2ErrorCode::REFUSED_STREAM);
- }),
+ },
testing::Return(OnHeaderResult::HEADER_RST_STREAM)));
const int64_t stream_result = adapter->ProcessBytes(stream_frames);
@@ -6422,11 +6422,11 @@
EXPECT_CALL(visitor, OnFrameHeader(3, _, kMetadataFrameType, 0));
EXPECT_CALL(visitor, OnBeginMetadataForStream(3, _));
EXPECT_CALL(visitor, OnMetadataForStream(3, "This is the re"))
- .WillOnce(testing::DoAll(testing::InvokeWithoutArgs([&adapter]() {
- adapter->SubmitRst(
- 3, Http2ErrorCode::REFUSED_STREAM);
- }),
- testing::Return(true)));
+ .WillOnce(testing::DoAll(
+ [&adapter]() {
+ adapter->SubmitRst(3, Http2ErrorCode::REFUSED_STREAM);
+ },
+ testing::Return(true)));
// The rest of the metadata is not delivered to the visitor.
const int64_t result = adapter->ProcessBytes(frames);
@@ -6906,10 +6906,10 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/this/is/request/one"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&adapter, kSentinel1]() {
+ .WillOnce([&adapter, kSentinel1]() {
adapter->SetStreamUserData(1, const_cast<char*>(kSentinel1));
return true;
- }));
+ });
EXPECT_CALL(visitor, OnEndStream(1));
const int64_t result = adapter->ProcessBytes(frames);
diff --git a/quiche/http2/adapter/oghttp2_session_test.cc b/quiche/http2/adapter/oghttp2_session_test.cc
index d69cba6..d6926f1 100644
--- a/quiche/http2/adapter/oghttp2_session_test.cc
+++ b/quiche/http2/adapter/oghttp2_session_test.cc
@@ -865,10 +865,10 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/this/is/request/one"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&session, kSentinel1]() {
+ .WillOnce([&session, kSentinel1]() {
session.SetStreamUserData(1, const_cast<char*>(kSentinel1));
return true;
- }));
+ });
EXPECT_CALL(visitor, OnFrameHeader(1, 4, WINDOW_UPDATE, 0));
EXPECT_CALL(visitor, OnWindowUpdate(1, 2000));
EXPECT_CALL(visitor, OnFrameHeader(1, 25, DATA, 0));
@@ -1034,10 +1034,10 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/this/is/request/one"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&session, kSentinel1]() {
+ .WillOnce([&session, kSentinel1]() {
session.SetStreamUserData(1, const_cast<char*>(kSentinel1));
return true;
- }));
+ });
EXPECT_CALL(visitor, OnEndStream(1));
const int64_t result = session.ProcessBytes(frames);
@@ -1360,15 +1360,14 @@
EXPECT_CALL(visitor, OnHeaderForStream(1, ":authority", "example.com"));
EXPECT_CALL(visitor, OnHeaderForStream(1, ":path", "/"));
EXPECT_CALL(visitor, OnEndHeadersForStream(1));
- EXPECT_CALL(visitor, OnEndStream(1))
- .WillOnce(testing::InvokeWithoutArgs([&session]() {
- int res = session.SubmitResponse(/*stream_id=*/1,
- ToHeaders({{":status", "200"}}),
- /*end_stream=*/true);
- EXPECT_EQ(res, 0);
- EXPECT_EQ(0, session.Send());
- return true;
- }));
+ EXPECT_CALL(visitor, OnEndStream(1)).WillOnce([&session]() {
+ int res =
+ session.SubmitResponse(/*stream_id=*/1, ToHeaders({{":status", "200"}}),
+ /*end_stream=*/true);
+ EXPECT_EQ(res, 0);
+ EXPECT_EQ(0, session.Send());
+ return true;
+ });
EXPECT_CALL(visitor, OnBeforeFrameSent(SETTINGS, 0, _, _));
EXPECT_CALL(visitor, OnFrameSent(SETTINGS, 0, _, _, 0));
@@ -1416,10 +1415,10 @@
EXPECT_CALL(visitor, OnFrameHeader(1, _, DATA, 0x0));
EXPECT_CALL(visitor, OnBeginDataForStream(1, _));
EXPECT_CALL(visitor, OnDataForStream(1, "Request body"))
- .WillOnce(testing::InvokeWithoutArgs([&session]() {
+ .WillOnce([&session]() {
session.Consume(1, 12);
return true;
- }));
+ });
session.ProcessBytes(frames);
@@ -1502,10 +1501,10 @@
EXPECT_CALL(visitor, OnFrameHeader(1, _, DATA, 0x0));
EXPECT_CALL(visitor, OnBeginDataForStream(1, _));
EXPECT_CALL(visitor, OnDataForStream(1, "Request body"))
- .WillOnce(testing::InvokeWithoutArgs([&session]() {
+ .WillOnce([&session]() {
session.Consume(1, 12);
return true;
- }));
+ });
session.ProcessBytes(frames);