From 8dcafda2fffa6b856d41f86f3dded18c79fbcedf Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Wed, 15 Oct 2025 08:41:42 +0100 Subject: [PATCH] [cr143] Single-argument `testing::{DoAll,Invoke}` deprecated This change removes all the remaining occurrences of these functions being used with a single argument, following upstream deprecation. Chromium changes: https://chromium.googlesource.com/chromium/src/+/b843c806672c1e1b950f0868ddde79390c1eea69 commit b843c806672c1e1b950f0868ddde79390c1eea69 Author: Jonathan Lee Date: Mon Oct 13 16:04:32 2025 -0700 Roll src/third_party/googletest/src/ 244cec869..7917641ff (4 commits) **Note to gardeners**: This CL may be incompatible with other CLs that add new usage of single-argument `testing::{DoAll,Invoke}`, which are deprecated. Please prefer forward-fixing by cleaning up the deprecated callsites instead of reverting this roll. The forward-fix is well- understood (crbug.com/439838457), and we want CQ to stop new deprecated callsites from landing. https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/244cec869d12..7917641ff965 $ git log 244cec869..7917641ff --date=short --no-merges --format='%ad %ae %s' 2025-09-02 dmauro Bump Abseil dependency to 20250814.0 2025-08-24 absl-team Remove unused syslog dependency for Fuchsia. 2025-08-19 absl-team Internal header include changes. 2025-08-16 absl-team Deprecate single-argument DoAll and Invoke. Created with: roll-dep src/third_party/googletest/src Change-Id: Id197f789d82c374e16b07153012983792fcb4be7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6920668 Reviewed-by: Brian Sheedy Commit-Queue: Jonathan Lee Cr-Commit-Position: refs/heads/main@{#1529188} --- browser/ai_chat/tools/content_agent_tool_base_test.cc | 8 ++++---- .../ai_chat/core/browser/conversation_handler_unittest.cc | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/browser/ai_chat/tools/content_agent_tool_base_test.cc b/browser/ai_chat/tools/content_agent_tool_base_test.cc index 376641a71f7..66c1ffbbb4b 100644 --- a/browser/ai_chat/tools/content_agent_tool_base_test.cc +++ b/browser/ai_chat/tools/content_agent_tool_base_test.cc @@ -51,12 +51,12 @@ ContentAgentToolBaseTest::RunWithExpectedSuccess( base::RunLoop run_loop; optimization_guide::proto::Actions captured_actions; EXPECT_CALL(*mock_task_provider_, ExecuteActions) - .WillOnce(testing::Invoke([&captured_actions, &run_loop]( - optimization_guide::proto::Actions actions, - Tool::UseToolCallback callback) { + .WillOnce([&captured_actions, &run_loop]( + optimization_guide::proto::Actions actions, + Tool::UseToolCallback callback) { captured_actions = std::move(actions); run_loop.Quit(); - })); + }); tool_->UseTool(input_json, base::DoNothing()); run_loop.Run(); diff --git a/components/ai_chat/core/browser/conversation_handler_unittest.cc b/components/ai_chat/core/browser/conversation_handler_unittest.cc index a1d268f2f7a..75fcc7ad3fd 100644 --- a/components/ai_chat/core/browser/conversation_handler_unittest.cc +++ b/components/ai_chat/core/browser/conversation_handler_unittest.cc @@ -2575,8 +2575,7 @@ TEST_F(ConversationHandlerUnitTest, // Mock engine to return no new entry base::RunLoop run_loop; EXPECT_CALL(*engine, GenerateAssistantResponse) - .WillOnce(testing::DoAll( - // Complete the request + .WillOnce( // Complete the request testing::WithArg<8>( [&](EngineConsumer::GenerationCompletedCallback callback) { std::move(callback).Run( @@ -2585,7 +2584,7 @@ TEST_F(ConversationHandlerUnitTest, mojom::CompletionEvent::New("")), std::nullopt))); run_loop.QuitWhenIdle(); - }))); + })); // Submit a human entry to trigger the mocked response conversation_handler_->SubmitHumanConversationEntry("Test question",