Commit fd7f88c2 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::ScopedNestableTaskAllower to RunLoop::Type::kNestableTasksAllowed in /headless

This is another scripted pass done by a slightly modified version of
https://bugs.chromium.org/p/chromium/issues/detail?id=781352#c1 which
has a better notion of "scope".

The script should have replaced a MessageLoop::ScopedNestableTaskAllower
in the same scope as a RunLoop with a RunLoop of
Type::kNestableTasksAllowed.

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

R=rvera@chromium.org

Bug: 781352
Change-Id: I5429418614b13b654af86c4764ac1c9066a21f95
Reviewed-on: https://chromium-review.googlesource.com/1014780Reviewed-by: default avatarAlex Clarke <alexclarke@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551485}
parent 0e6e9217
...@@ -226,7 +226,7 @@ void HeadlessRenderTest::RunDevTooledTest() { ...@@ -226,7 +226,7 @@ void HeadlessRenderTest::RunDevTooledTest() {
// Pause virtual time until we actually start loading content. // Pause virtual time until we actually start loading content.
{ {
base::RunLoop run_loop; base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed);
devtools_client_->GetEmulation()->GetExperimental()->SetVirtualTimePolicy( devtools_client_->GetEmulation()->GetExperimental()->SetVirtualTimePolicy(
emulation::SetVirtualTimePolicyParams::Builder() emulation::SetVirtualTimePolicyParams::Builder()
.SetPolicy(emulation::VirtualTimePolicy::PAUSE) .SetPolicy(emulation::VirtualTimePolicy::PAUSE)
...@@ -240,18 +240,14 @@ void HeadlessRenderTest::RunDevTooledTest() { ...@@ -240,18 +240,14 @@ void HeadlessRenderTest::RunDevTooledTest() {
.Build(), .Build(),
base::BindOnce(&SetVirtualTimePolicyDoneCallback, &run_loop)); base::BindOnce(&SetVirtualTimePolicyDoneCallback, &run_loop));
base::MessageLoop::ScopedNestableTaskAllower nest_loop(
base::MessageLoop::current());
run_loop.Run(); run_loop.Run();
} }
{ {
base::RunLoop run_loop; base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed);
// Note AdditionalVirtualTimeBudget will self delete. // Note AdditionalVirtualTimeBudget will self delete.
new AdditionalVirtualTimeBudget(virtual_time_controller_.get(), this, new AdditionalVirtualTimeBudget(virtual_time_controller_.get(), this,
&run_loop, 5000); &run_loop, 5000);
base::MessageLoop::ScopedNestableTaskAllower nest_loop(
base::MessageLoop::current());
run_loop.Run(); run_loop.Run();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment