Commit 654004bd authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

mash: Speculative fix for content_browsertests hang

Speculative fix to single process mash content_browsertests
start-up hang by allowing nested task while waiting for display.

Bug: 892173
Change-Id: Ia146293d8f2553cd8233feae80786e56402c7c55
Reviewed-on: https://chromium-review.googlesource.com/c/1262925Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597150}
parent d9c060d1
......@@ -100,7 +100,10 @@ void WMTestHelper::InitMusHost(service_manager::Connector* connector,
if (running_in_ws_process) {
// Spin message loop to wait for displays when WindowService runs in the
// same process to avoid deadlock.
display_wait_loop_.Run();
display_wait_loop_ = std::make_unique<base::RunLoop>(
base::RunLoop::Type::kNestableTasksAllowed);
display_wait_loop_->Run();
display_wait_loop_.reset();
// Bind to test_ws so that it could be shutdown at the right time.
connector->BindInterface(test_ws::mojom::kServiceName, &test_ws_);
......@@ -142,7 +145,8 @@ void WMTestHelper::OnDisplaysChanged(
int64_t primary_display_id,
int64_t internal_display_id,
int64_t display_id_for_new_windows) {
display_wait_loop_.Quit();
if (display_wait_loop_)
display_wait_loop_->Quit();
}
} // namespace wm
......@@ -98,7 +98,7 @@ class WMTestHelper : public aura::client::WindowParentingClient,
std::unique_ptr<aura::client::FocusClient> focus_client_;
// Loop to wait for |host_| gets embedded under mus.
base::RunLoop display_wait_loop_;
std::unique_ptr<base::RunLoop> display_wait_loop_;
test_ws::mojom::TestWsPtr test_ws_;
......
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