summaryrefslogtreecommitdiffstats
path: root/ash/display/screen_position_controller_unittest.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 09:30:00 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 09:30:00 +0000
commitb65c59fa456760fcb59a818d8d98f7a26de5f0ad (patch)
tree81fd3b5b5aca299db72125ec3052e0b61a9b4dfb /ash/display/screen_position_controller_unittest.cc
parent0319428dfde7e055d1d10cce194225eefbebbdb3 (diff)
downloadchromium_src-b65c59fa456760fcb59a818d8d98f7a26de5f0ad.zip
chromium_src-b65c59fa456760fcb59a818d8d98f7a26de5f0ad.tar.gz
chromium_src-b65c59fa456760fcb59a818d8d98f7a26de5f0ad.tar.bz2
[Cleanup]
* Removed public API that returns pointer to internal display. * changed to use ScreenAsh::GetSecondaryDisplay instead of one in DisplayController * removed DisplayController::FindDisplayForRootWindow as there is only one caller. BUG=253991 Review URL: https://chromiumcodereview.appspot.com/19287005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212304 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/display/screen_position_controller_unittest.cc')
-rw-r--r--ash/display/screen_position_controller_unittest.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/ash/display/screen_position_controller_unittest.cc b/ash/display/screen_position_controller_unittest.cc
index 76123b2..3b62f52 100644
--- a/ash/display/screen_position_controller_unittest.cc
+++ b/ash/display/screen_position_controller_unittest.cc
@@ -5,6 +5,7 @@
#include "ash/display/screen_position_controller.h"
#include "ash/display/display_controller.h"
+#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/test/ash_test_base.h"
#include "ash/test/shell_test_api.h"
@@ -177,11 +178,9 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenHiDPI) {
EXPECT_EQ("100,500", root_windows[1]->GetHostOrigin().ToString());
EXPECT_EQ("200x200", root_windows[1]->GetHostSize().ToString());
- ash::DisplayController* display_controller =
- Shell::GetInstance()->display_controller();
// Put |window_| to the primary 2x display.
window_->SetBoundsInScreen(gfx::Rect(20, 20, 50, 50),
- display_controller->GetPrimaryDisplay());
+ Shell::GetScreen()->GetPrimaryDisplay());
// (30, 30) means the host coordinate, so the point is still on the primary
// root window. Since it's 2x, the specified native point was halved.
EXPECT_EQ("15,15", ConvertHostPointToScreen(30, 30));
@@ -205,11 +204,9 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenRotate) {
// 1st display is rotated 90 clockise, and 2nd display is rotated
// 270 clockwise.
UpdateDisplay("100+100-200x200/r,100+500-200x200/l");
- ash::DisplayController* display_controller =
- Shell::GetInstance()->display_controller();
// Put |window_| to the 1st.
window_->SetBoundsInScreen(gfx::Rect(20, 20, 50, 50),
- display_controller->GetPrimaryDisplay());
+ Shell::GetScreen()->GetPrimaryDisplay());
// The point is on the 1st host.
EXPECT_EQ("70,149", ConvertHostPointToScreen(50, 70));
@@ -221,7 +218,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenRotate) {
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
- *display_controller->GetSecondaryDisplay());
+ ScreenAsh::GetSecondaryDisplay());
Shell::RootWindowList root_windows =
Shell::GetInstance()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());
@@ -239,11 +236,9 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenRotate) {
TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenUIScale) {
// 1st display is 2x density with 1.5 UI scale.
UpdateDisplay("100+100-200x200*2@1.5,100+500-200x200");
- ash::DisplayController* display_controller =
- Shell::GetInstance()->display_controller();
// Put |window_| to the 1st.
window_->SetBoundsInScreen(gfx::Rect(20, 20, 50, 50),
- display_controller->GetPrimaryDisplay());
+ Shell::GetScreen()->GetPrimaryDisplay());
// The point is on the 1st host.
EXPECT_EQ("45,45", ConvertHostPointToScreen(60, 60));
@@ -255,7 +250,7 @@ TEST_F(ScreenPositionControllerTest, MAYBE_ConvertHostPointToScreenUIScale) {
// Move |window_| to the 2nd.
window_->SetBoundsInScreen(gfx::Rect(300, 20, 50, 50),
- *display_controller->GetSecondaryDisplay());
+ ScreenAsh::GetSecondaryDisplay());
Shell::RootWindowList root_windows =
Shell::GetInstance()->GetAllRootWindows();
EXPECT_EQ(root_windows[1], window_->GetRootWindow());