Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: ash/test/ash_test_base.cc

Issue 2694623016: chromeos: Makes AshTestBase/Helper target mash when appropriate (Closed)
Patch Set: feedback Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/ash_test_base.h ('k') | ash/test/ash_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index c3dde233aae96220911d463116d46a773d7e2588..3da727ac4ffd77821867c1dc5b56ce714eaf9f05 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -63,9 +63,9 @@ class AshEventGeneratorDelegate
const gfx::Point& point_in_screen) const override {
display::Screen* screen = display::Screen::GetScreen();
display::Display display = screen->GetDisplayNearestPoint(point_in_screen);
- return Shell::GetInstance()
- ->window_tree_host_manager()
+ return WmShell::Get()
->GetRootWindowForDisplayId(display.id())
+ ->aura_window()
->GetHost();
}
@@ -134,7 +134,9 @@ void AshTestBase::SetUp() {
// Move the mouse cursor to far away so that native events doesn't
// interfere test expectations.
Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000));
- Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
+ // TODO: mash needs to support CursorManager. http://crbug.com/637853.
+ if (!WmShell::Get()->IsRunningInMash())
+ Shell::GetInstance()->cursor_manager()->EnableMouseEvents();
// Changing GestureConfiguration shouldn't make tests fail. These values
// prevent unexpected events from being generated during tests. Such as
@@ -196,8 +198,13 @@ display::Display::Rotation AshTestBase::GetCurrentInternalDisplayRotation() {
// static
void AshTestBase::UpdateDisplay(const std::string& display_specs) {
- display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
- .UpdateDisplay(display_specs);
+ if (WmShell::Get()->IsRunningInMash()) {
+ ash_test_helper_->UpdateDisplayForMash(display_specs);
+ } else {
+ display::test::DisplayManagerTestApi(
+ Shell::GetInstance()->display_manager())
+ .UpdateDisplay(display_specs);
+ }
}
aura::Window* AshTestBase::CurrentContext() {
@@ -264,9 +271,8 @@ aura::Window* AshTestBase::CreateTestWindowInShellWithDelegateAndType(
} else {
display::Display display =
display::Screen::GetScreen()->GetDisplayMatching(bounds);
- aura::Window* root = Shell::GetInstance()
- ->window_tree_host_manager()
- ->GetRootWindowForDisplayId(display.id());
+ aura::Window* root =
+ WmShell::Get()->GetRootWindowForDisplayId(display.id())->aura_window();
gfx::Point origin = bounds.origin();
::wm::ConvertPointFromScreen(root, &origin);
window->SetBounds(gfx::Rect(origin, bounds.size()));
@@ -388,5 +394,9 @@ void AshTestBase::SwapPrimaryDisplay() {
display_manager()->GetSecondaryDisplay().id());
}
+display::Display AshTestBase::GetSecondaryDisplay() {
+ return ash_test_helper_->GetSecondaryDisplay();
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « ash/test/ash_test_base.h ('k') | ash/test/ash_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698