Index: chrome/browser/extensions/api/system_display/display_info_provider_chromeos_unittest.cc |
diff --git a/chrome/browser/extensions/api/system_display/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/api/system_display/display_info_provider_chromeos_unittest.cc |
index c91e725251d2b56b0ac13cbeb5ed35a3ddc3f373..4dd2fe9afdf5b26d6b39c9c192a12843081dcf27 100644 |
--- a/chrome/browser/extensions/api/system_display/display_info_provider_chromeos_unittest.cc |
+++ b/chrome/browser/extensions/api/system_display/display_info_provider_chromeos_unittest.cc |
@@ -6,7 +6,7 @@ |
#include "ash/display/display_controller.h" |
#include "ash/display/display_manager.h" |
-#include "ash/screen_ash.h" |
+#include "ash/screen_util.h" |
#include "ash/shell.h" |
#include "ash/test/ash_test_base.h" |
#include "ash/test/display_manager_test_api.h" |
@@ -312,7 +312,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetBounds) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftExact) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-520)); |
info.bounds_origin_y.reset(new int(50)); |
@@ -331,7 +331,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftExact) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightExact) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(1200)); |
info.bounds_origin_y.reset(new int(100)); |
@@ -350,7 +350,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightExact) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopExact) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(1100)); |
info.bounds_origin_y.reset(new int(-400)); |
@@ -369,7 +369,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopExact) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginBottomExact) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-350)); |
info.bounds_origin_y.reset(new int(600)); |
@@ -388,7 +388,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginBottomExact) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSameCenter) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(340)); |
info.bounds_origin_y.reset(new int(100)); |
@@ -407,7 +407,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSameCenter) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftOutside) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-1040)); |
info.bounds_origin_y.reset(new int(100)); |
@@ -426,7 +426,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftOutside) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopOutside) { |
UpdateDisplay("1200x600,520x400"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-360)); |
info.bounds_origin_y.reset(new int(-301)); |
@@ -446,7 +446,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
SetBoundsOriginLeftButSharesBottomSide) { |
UpdateDisplay("1200x600,1000x100"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-650)); |
info.bounds_origin_y.reset(new int(700)); |
@@ -466,7 +466,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
SetBoundsOriginRightButSharesTopSide) { |
UpdateDisplay("1200x600,1000x100"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(850)); |
info.bounds_origin_y.reset(new int(-150)); |
@@ -486,7 +486,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
SetBoundsOriginTopButSharesLeftSide) { |
UpdateDisplay("1200x600,1000x100/l"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(-150)); |
info.bounds_origin_y.reset(new int(-650)); |
@@ -506,7 +506,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
SetBoundsOriginBottomButSharesRightSide) { |
UpdateDisplay("1200x600,1000x100/l"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(1350)); |
info.bounds_origin_y.reset(new int(450)); |
@@ -525,7 +525,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginPrimaryHiDPI) { |
UpdateDisplay("1200x600*2,500x500"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(250)); |
info.bounds_origin_y.reset(new int(-100)); |
@@ -544,7 +544,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginPrimaryHiDPI) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSecondaryHiDPI) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(450)); |
info.bounds_origin_y.reset(new int(-100)); |
@@ -563,7 +563,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSecondaryHiDPI) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBounds) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(0x200001)); |
info.bounds_origin_y.reset(new int(-100)); |
@@ -582,7 +582,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBounds) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBoundsNegative) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(300)); |
info.bounds_origin_y.reset(new int(-0x200001)); |
@@ -601,7 +601,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBoundsNegative) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginMaxValues) { |
UpdateDisplay("1200x4600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(200000)); |
info.bounds_origin_y.reset(new int(10)); |
@@ -620,7 +620,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginMaxValues) { |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOnPrimary) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(300)); |
info.is_primary.reset(new bool(true)); |
@@ -636,14 +636,14 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOnPrimary) { |
EXPECT_EQ("1200,0 300x500", secondary.bounds().ToString()); |
// The operation failed because the primary property would be set before |
// setting bounds. The primary display shouldn't have been changed, though. |
- EXPECT_NE(ash::DisplayController::GetPrimaryDisplay().id(), secondary.id()); |
+ EXPECT_NE(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); |
} |
TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
- const gfx::Display& primary = GetDisplayController()->GetPrimaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
+ const gfx::Display& primary = ash::Shell::GetScreen()->GetPrimaryDisplay(); |
api::system_display::DisplayProperties info; |
info.bounds_origin_x.reset(new int(300)); |
@@ -663,7 +663,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) { |
TEST_F(DisplayInfoProviderChromeosTest, SetRotation) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.rotation.reset(new int(90)); |
@@ -699,7 +699,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotation) { |
EXPECT_EQ("0,0 300x500", secondary.bounds().ToString()); |
EXPECT_EQ(gfx::Display::ROTATE_180, secondary.rotation()); |
- EXPECT_EQ(ash::DisplayController::GetPrimaryDisplay().id(), secondary.id()); |
+ EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); |
info.rotation.reset(new int(0)); |
CallSetDisplayUnitInfo(base::Int64ToString(secondary.id()), info, |
@@ -710,13 +710,13 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotation) { |
EXPECT_EQ("0,0 300x500", secondary.bounds().ToString()); |
EXPECT_EQ(gfx::Display::ROTATE_0, secondary.rotation()); |
- EXPECT_EQ(ash::DisplayController::GetPrimaryDisplay().id(), secondary.id()); |
+ EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().id(), secondary.id()); |
} |
TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.rotation.reset(new int(91)); |
@@ -732,7 +732,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) { |
TEST_F(DisplayInfoProviderChromeosTest, SetNegativeOverscan) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.overscan.reset(new api::system_display::Insets); |
info.overscan->left= -10; |
@@ -795,7 +795,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetNegativeOverscan) { |
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanHorizontalBounds) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.overscan.reset(new api::system_display::Insets); |
// Horizontal overscan is 151, which would make the bounds width 149. |
@@ -817,7 +817,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanHorizontalBounds) { |
TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanVerticalBounds) { |
UpdateDisplay("1200x600,600x1000"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.overscan.reset(new api::system_display::Insets); |
// Vertical overscan is 501, which would make the bounds height 499. |
@@ -839,7 +839,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanVerticalBounds) { |
TEST_F(DisplayInfoProviderChromeosTest, SetOverscan) { |
UpdateDisplay("1200x600,600x1000*2"); |
- const gfx::Display& secondary = ash::ScreenAsh::GetSecondaryDisplay(); |
+ const gfx::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
api::system_display::DisplayProperties info; |
info.overscan.reset(new api::system_display::Insets); |
info.overscan->left= 20; |