Skip to content

Commit

Permalink
Replace base::Passed in frame_impl_browsertest.cc
Browse files Browse the repository at this point in the history
The same behavior can be achieved via base::BindLambdaForTesting.

Bug: 1326449
Change-Id: I957a6b5cae9212afc8428d44e8ecb86052d4544c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5073014
Commit-Queue: Zijie He <zijiehe@google.com>
Reviewed-by: Zijie He <zijiehe@google.com>
Auto-Submit: Andrew Rayskiy <greengrape@google.com>
Cr-Commit-Position: refs/heads/main@{#1231387}
  • Loading branch information
GrapeGreen authored and Chromium LUCI CQ committed Nov 30, 2023
1 parent 2ca66ba commit b725a32
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fuchsia_web/webengine/browser/frame_impl_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "base/fuchsia/fuchsia_logging.h"
#include "base/fuchsia/mem_buffer_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
Expand Down Expand Up @@ -549,19 +550,18 @@ class ChunkedHttpTransactionFactory : public net::test_server::HttpResponse {
IN_PROC_BROWSER_TEST_F(FrameImplTest, NavigationEventDuringPendingLoad) {
auto frame = FrameForTest::Create(context(), {});

ChunkedHttpTransactionFactory* factory = new ChunkedHttpTransactionFactory;
auto factory = std::make_unique<ChunkedHttpTransactionFactory>();
base::RunLoop transaction_created_run_loop;
factory->SetOnResponseCreatedCallback(
transaction_created_run_loop.QuitClosure());
embedded_test_server()->RegisterRequestHandler(base::BindRepeating(
&net::test_server::HandlePrefixedRequest, "/pausable",
base::BindRepeating(
[](std::unique_ptr<ChunkedHttpTransactionFactory> out_factory,
const net::test_server::HttpRequest&)
base::BindLambdaForTesting(
[&](const net::test_server::HttpRequest&)
-> std::unique_ptr<net::test_server::HttpResponse> {
return out_factory;
},
base::Passed(base::WrapUnique(factory)))));
CHECK(factory);
return std::move(factory);
})));

net::test_server::EmbeddedTestServerHandle test_server_handle;
ASSERT_TRUE(test_server_handle =
Expand Down

0 comments on commit b725a32

Please sign in to comment.