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

Unified Diff: ash/display/screen_position_controller_unittest.cc

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 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/display/root_window_transformers_unittest.cc ('k') | ash/display/unified_mouse_warp_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/screen_position_controller_unittest.cc
diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc
index ba8a507b88a17e631ce12a3c0656b1189e2a15ec..00e0ed458bdc76700683939e91db07f63758eda4 100644
--- a/ash/display/screen_position_controller_unittest.cc
+++ b/ash/display/screen_position_controller_unittest.cc
@@ -47,16 +47,6 @@ namespace test {
namespace {
-void SetSecondaryDisplayLayout(display::DisplayPlacement::Position position) {
- std::unique_ptr<display::DisplayLayout> layout(Shell::GetInstance()
- ->display_manager()
- ->GetCurrentDisplayLayout()
- .Copy());
- layout->placement_list[0].position = position;
- Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
- std::move(layout));
-}
-
ScreenPositionController* GetScreenPositionController() {
ShellTestApi test_api(Shell::GetInstance());
return test_api.screen_position_controller();
@@ -90,6 +80,13 @@ class ScreenPositionControllerTest : public test::AshTestBase {
return point.ToString();
}
+ void SetSecondaryDisplayLayout(display::DisplayPlacement::Position position) {
+ std::unique_ptr<display::DisplayLayout> layout(
+ display_manager()->GetCurrentDisplayLayout().Copy());
+ layout->placement_list[0].position = position;
+ display_manager()->SetLayoutForCurrentDisplays(std::move(layout));
+ }
+
protected:
std::unique_ptr<aura::Window> window_;
aura::test::TestWindowDelegate window_delegate_;
@@ -242,7 +239,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenRotate) {
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
- ScreenUtil::GetSecondaryDisplay());
+ display_manager()->GetSecondaryDisplay());
aura::Window::Windows root_windows =
Shell::GetInstance()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
@@ -274,7 +271,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenUIScale) {
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
- ScreenUtil::GetSecondaryDisplay());
+ display_manager()->GetSecondaryDisplay());
aura::Window::Windows root_windows =
Shell::GetInstance()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
@@ -332,7 +329,7 @@ TEST_F(ScreenPositionControllerTest,
// Create a window on the secondary display.
window_->SetBoundsInScreen(gfx::Rect(600, 0, 400, 400),
- ScreenUtil::GetSecondaryDisplay());
+ display_manager()->GetSecondaryDisplay());
// Move the mouse cursor over |window_|. Synthetic mouse moves are dispatched
// asynchronously when a window which contains the mouse cursor is destroyed.
« no previous file with comments | « ash/display/root_window_transformers_unittest.cc ('k') | ash/display/unified_mouse_warp_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698