Commit 92a861ac authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Use AshUIControls for UI tests with no browser

LoginCursorTest.CursorHidden and OobeTest.Accelerator are still
crashing even after the refactoring of UIControls and aura::Env.
Actually, these tests do not require browser windows therefore
UIControlsOzone is created with nullptr WindowTreeHost which is
not expected.

Thinking about that, such test cases actually do controls for
the UI within Ash -- therefore AshUIControls should be used.

Test: interactive_ui_tests with --enable-features=SingleProcessMash
Bug: 883523
Change-Id: I3d6e1ecb569551a7eacfce979c4b543771f19fc6
Reviewed-on: https://chromium-review.googlesource.com/1236842Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592953}
parent 6dcf3d19
......@@ -487,13 +487,18 @@ void InProcessBrowserTest::PreRunTestOnMainThread() {
}
#if defined(OS_CHROMEOS)
if (features::IsUsingWindowService()) {
aura::WindowTreeHost* host =
browser_ ? browser_->window()->GetNativeWindow()->GetHost() : nullptr;
// OobeTest and LoginCursorTest do not have the browser window but wants to
// interact with its UI through UIControls -- and those UI are actually for
// Ash (login / lock screen / oobe). Thus AshUIControls should be created for
// such test.
aura::WindowTreeHost* host = nullptr;
if (features::IsUsingWindowService() && browser_)
host = browser_->window()->GetNativeWindow()->GetHost();
if (host)
ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(host));
} else {
else
ui_controls::InstallUIControlsAura(ash::test::CreateAshUIControls());
}
#endif
#if !defined(OS_ANDROID)
......
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