Chromium Code Reviews| Index: chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
| diff --git a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
| index 51fa22380970e02a4ed9047edc81cf20ac362c66..c9ff1701cd0f07c041f225f21f976820299a3120 100644 |
| --- a/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
| +++ b/chrome/browser/extensions/display_info_provider_chromeos_unittest.cc |
| @@ -10,7 +10,8 @@ |
| #include "ash/common/wm_shell.h" |
| #include "ash/display/display_manager.h" |
| #include "ash/display/screen_orientation_controller_chromeos.h" |
| -#include "ash/screen_util.h" |
| +//#include "ash/screen_util.h" |
|
oshima
2016/10/04 00:47:16
remove this
rjkroege
2016/10/05 00:21:46
Done.
|
| +#include "ash/shell.h" |
| #include "ash/shell.h" |
| #include "ash/test/ash_test_base.h" |
| #include "ash/test/display_manager_test_api.h" |
| @@ -300,7 +301,7 @@ TEST_F(DisplayInfoProviderChromeosTest, GetDPI) { |
| EXPECT_EQ(96 / 2, result[1].dpi_x); |
| EXPECT_EQ(96 / 2, result[1].dpi_y); |
| - ash::test::SwapPrimaryDisplay(); |
| + SwapPrimaryDisplay(); |
| result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| @@ -409,7 +410,8 @@ TEST_F(DisplayInfoProviderChromeosTest, GetMirroring) { |
| TEST_F(DisplayInfoProviderChromeosTest, GetBounds) { |
| UpdateDisplay("600x600, 400x520"); |
| GetDisplayManager()->SetLayoutForCurrentDisplays( |
| - ash::test::CreateDisplayLayout(display::DisplayPlacement::LEFT, -40)); |
| + ash::test::CreateDisplayLayout(display_manager(), |
| + display::DisplayPlacement::LEFT, -40)); |
| DisplayUnitInfoList result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| @@ -419,7 +421,8 @@ TEST_F(DisplayInfoProviderChromeosTest, GetBounds) { |
| SystemInfoDisplayBoundsToString(result[1].bounds)); |
| GetDisplayManager()->SetLayoutForCurrentDisplays( |
| - ash::test::CreateDisplayLayout(display::DisplayPlacement::TOP, 40)); |
| + ash::test::CreateDisplayLayout(display_manager(), |
| + display::DisplayPlacement::TOP, 40)); |
| result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| @@ -429,7 +432,8 @@ TEST_F(DisplayInfoProviderChromeosTest, GetBounds) { |
| SystemInfoDisplayBoundsToString(result[1].bounds)); |
| GetDisplayManager()->SetLayoutForCurrentDisplays( |
| - ash::test::CreateDisplayLayout(display::DisplayPlacement::BOTTOM, 80)); |
| + ash::test::CreateDisplayLayout(display_manager(), |
| + display::DisplayPlacement::BOTTOM, 80)); |
| result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| ASSERT_EQ(2u, result.size()); |
| @@ -495,7 +499,7 @@ TEST_F(DisplayInfoProviderChromeosTest, Layout) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftExact) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-520)); |
| info.bounds_origin_y.reset(new int(50)); |
| @@ -514,7 +518,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftExact) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightExact) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(1200)); |
| info.bounds_origin_y.reset(new int(100)); |
| @@ -533,7 +537,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightExact) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopExact) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(1100)); |
| info.bounds_origin_y.reset(new int(-400)); |
| @@ -552,7 +556,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopExact) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginBottomExact) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-350)); |
| info.bounds_origin_y.reset(new int(600)); |
| @@ -571,7 +575,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginBottomExact) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSameCenter) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(340)); |
| info.bounds_origin_y.reset(new int(100)); |
| @@ -590,7 +594,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSameCenter) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftOutside) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-1040)); |
| info.bounds_origin_y.reset(new int(100)); |
| @@ -609,7 +613,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginLeftOutside) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopOutside) { |
| UpdateDisplay("1200x600,520x400"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-360)); |
| info.bounds_origin_y.reset(new int(-301)); |
| @@ -629,7 +633,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
| SetBoundsOriginLeftButSharesBottomSide) { |
| UpdateDisplay("1200x600,1000x100"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-650)); |
| info.bounds_origin_y.reset(new int(700)); |
| @@ -648,7 +652,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightButSharesTopSide) { |
| UpdateDisplay("1200x600,1000x100"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(850)); |
| info.bounds_origin_y.reset(new int(-150)); |
| @@ -667,7 +671,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginRightButSharesTopSide) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginTopButSharesLeftSide) { |
| UpdateDisplay("1200x600,1000x100/l"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(-150)); |
| info.bounds_origin_y.reset(new int(-650)); |
| @@ -687,7 +691,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
| SetBoundsOriginBottomButSharesRightSide) { |
| UpdateDisplay("1200x600,1000x100/l"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(1350)); |
| info.bounds_origin_y.reset(new int(450)); |
| @@ -706,7 +710,7 @@ TEST_F(DisplayInfoProviderChromeosTest, |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginPrimaryHiDPI) { |
| UpdateDisplay("1200x600*2,500x500"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(250)); |
| info.bounds_origin_y.reset(new int(-100)); |
| @@ -725,7 +729,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginPrimaryHiDPI) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSecondaryHiDPI) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(450)); |
| info.bounds_origin_y.reset(new int(-100)); |
| @@ -744,7 +748,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginSecondaryHiDPI) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBounds) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(0x200001)); |
| info.bounds_origin_y.reset(new int(-100)); |
| @@ -763,7 +767,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBounds) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBoundsNegative) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(300)); |
| info.bounds_origin_y.reset(new int(-0x200001)); |
| @@ -782,7 +786,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOutOfBoundsNegative) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginMaxValues) { |
| UpdateDisplay("1200x4600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(200000)); |
| info.bounds_origin_y.reset(new int(10)); |
| @@ -801,7 +805,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginMaxValues) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOnPrimary) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.bounds_origin_x.reset(new int(300)); |
| info.is_primary.reset(new bool(true)); |
| @@ -824,7 +828,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginOnPrimary) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| const display::Display& primary = |
| display::Screen::GetScreen()->GetPrimaryDisplay(); |
| @@ -846,7 +850,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetBoundsOriginWithMirroring) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetRotation) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.rotation.reset(new int(90)); |
| @@ -967,7 +971,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetRotationDuringMaximizeMode) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.rotation.reset(new int(91)); |
| @@ -983,7 +987,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetInvalidRotation) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetNegativeOverscan) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.overscan.reset(new api::system_display::Insets); |
| info.overscan->left = -10; |
| @@ -1046,7 +1050,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetNegativeOverscan) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanHorizontalBounds) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->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. |
| @@ -1068,7 +1072,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanHorizontalBounds) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanVerticalBounds) { |
| UpdateDisplay("1200x600,600x1000"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->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. |
| @@ -1089,7 +1093,7 @@ TEST_F(DisplayInfoProviderChromeosTest, SetOverscanLargerThanVerticalBounds) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetOverscan) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| - const display::Display& secondary = ash::ScreenUtil::GetSecondaryDisplay(); |
| + const display::Display& secondary = display_manager()->GetSecondaryDisplay(); |
| api::system_display::DisplayProperties info; |
| info.overscan.reset(new api::system_display::Insets); |
| info.overscan->left = 20; |
| @@ -1118,7 +1122,9 @@ TEST_F(DisplayInfoProviderChromeosTest, SetOverscan) { |
| TEST_F(DisplayInfoProviderChromeosTest, SetOverscanForInternal) { |
| UpdateDisplay("1200x600,600x1000*2"); |
| const int64_t internal_display_id = |
| - ash::test::DisplayManagerTestApi().SetFirstDisplayAsInternalDisplay(); |
| + ash::test::DisplayManagerTestApi( |
| + ash::Shell::GetInstance()->display_manager()) |
| + .SetFirstDisplayAsInternalDisplay(); |
| api::system_display::DisplayProperties info; |
| info.overscan.reset(new api::system_display::Insets); |