Commit 97756170 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

mus/ash: Fix a few tests.

When mus is not hosting viz, ash is still responsible for managing
the mirroring. So update the MirrorWindowController as appropriate.

Also, do not have mus host viz for ash_unittests --mus.

BUG=786453

Change-Id: I964bb030113f1c0e8a5375056687e2c0ffdba53a
Reviewed-on: https://chromium-review.googlesource.com/808004Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521760}
parent c0a7f167
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "ui/base/class_property.h" #include "ui/base/class_property.h"
#include "ui/base/ime/input_method_factory.h" #include "ui/base/ime/input_method_factory.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_switches_util.h"
#include "ui/compositor/compositor.h" #include "ui/compositor/compositor.h"
#include "ui/display/display.h" #include "ui/display/display.h"
#include "ui/display/display_layout.h" #include "ui/display/display_layout.h"
...@@ -97,6 +98,11 @@ aura::Window* GetWindow(AshWindowTreeHost* ash_host) { ...@@ -97,6 +98,11 @@ aura::Window* GetWindow(AshWindowTreeHost* ash_host) {
return ash_host->AsWindowTreeHost()->window(); return ash_host->AsWindowTreeHost()->window();
} }
bool ShouldUpdateMirrorWindowController() {
return aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL ||
!::switches::IsMusHostingViz();
}
} // namespace } // namespace
// A utility class to store/restore focused/active window // A utility class to store/restore focused/active window
...@@ -651,7 +657,7 @@ void WindowTreeHostManager::OnHostResized(aura::WindowTreeHost* host) { ...@@ -651,7 +657,7 @@ void WindowTreeHostManager::OnHostResized(aura::WindowTreeHost* host) {
if (display_manager->UpdateDisplayBounds(display.id(), if (display_manager->UpdateDisplayBounds(display.id(),
host->GetBoundsInPixels())) { host->GetBoundsInPixels())) {
// The window server controls mirroring in Mus, not Ash. // The window server controls mirroring in Mus, not Ash.
if (aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL) if (ShouldUpdateMirrorWindowController())
mirror_window_controller_->UpdateWindow(); mirror_window_controller_->UpdateWindow();
cursor_window_controller_->UpdateContainer(); cursor_window_controller_->UpdateContainer();
} }
...@@ -662,7 +668,7 @@ void WindowTreeHostManager::CreateOrUpdateMirroringDisplay( ...@@ -662,7 +668,7 @@ void WindowTreeHostManager::CreateOrUpdateMirroringDisplay(
if (GetDisplayManager()->IsInMirrorMode() || if (GetDisplayManager()->IsInMirrorMode() ||
GetDisplayManager()->IsInUnifiedMode()) { GetDisplayManager()->IsInUnifiedMode()) {
// The window server controls mirroring in Mus, not Ash. // The window server controls mirroring in Mus, not Ash.
if (aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL) if (ShouldUpdateMirrorWindowController())
mirror_window_controller_->UpdateWindow(info_list); mirror_window_controller_->UpdateWindow(info_list);
cursor_window_controller_->UpdateContainer(); cursor_window_controller_->UpdateContainer();
} else { } else {
...@@ -672,7 +678,7 @@ void WindowTreeHostManager::CreateOrUpdateMirroringDisplay( ...@@ -672,7 +678,7 @@ void WindowTreeHostManager::CreateOrUpdateMirroringDisplay(
void WindowTreeHostManager::CloseMirroringDisplayIfNotNecessary() { void WindowTreeHostManager::CloseMirroringDisplayIfNotNecessary() {
// The window server controls mirroring in Mus, not Ash. // The window server controls mirroring in Mus, not Ash.
if (aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL) if (ShouldUpdateMirrorWindowController())
mirror_window_controller_->CloseIfNotNecessary(); mirror_window_controller_->CloseIfNotNecessary();
// If cursor_compositing is enabled for large cursor, the cursor window is // If cursor_compositing is enabled for large cursor, the cursor window is
// always on the desktop display (the visible cursor on the non-desktop // always on the desktop display (the visible cursor on the non-desktop
......
...@@ -75,9 +75,11 @@ void AshTestSuite::Initialize() { ...@@ -75,9 +75,11 @@ void AshTestSuite::Initialize() {
env_->set_context_factory(context_factory_.get()); env_->set_context_factory(context_factory_.get());
env_->set_context_factory_private(nullptr); env_->set_context_factory_private(nullptr);
// mus needs to host viz, because ash by itself cannot. // mus needs to host viz, because ash by itself cannot.
if (is_mash) {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kMus, switches::kMusHostVizValue); switches::kMus, switches::kMusHostVizValue);
} }
}
} }
void AshTestSuite::Shutdown() { void AshTestSuite::Shutdown() {
......
# TODO: fix this. It fails because GL_OES_texture_npot is not supported.
# http://crbug.com/775067.
-WorkspaceLayoutManagerBackdropTest.BackdropTest
# TODO: wire up mirroring and unified display.
# http://crbug.com/770243.
-DisplayManagerTest.SoftwareMirroring
-DisplayManagerTest.SingleDisplayToSoftwareMirroring
-MultiMirroringTest.SoftwareMirrorModeBasics
-UnifiedMouseWarpControllerTest.BoundaryTest
-UnifiedMouseWarpControllerTest.BoundaryTestGrid -UnifiedMouseWarpControllerTest.BoundaryTestGrid
-UnifiedMouseWarpControllerTest.WarpMouse -UnifiedMouseWarpControllerTest.WarpMouse
-UnifiedMouseWarpControllerTest.BoundaryAndWarpSimpleTest -UnifiedMouseWarpControllerTest.BoundaryAndWarpSimpleTest
......
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