diff options
author | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 21:45:32 +0000 |
---|---|---|
committer | jennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 21:45:32 +0000 |
commit | fda64c9e1866aff130c885c54431ee6b7d011788 (patch) | |
tree | 8c657b471e3cca8da0a08741cd96e1ec1c12d406 /ash/dip_unittest.cc | |
parent | 9441d7b2475bcb6b4b1bda6f1c89a5ce62ddc9f6 (diff) | |
download | chromium_src-fda64c9e1866aff130c885c54431ee6b7d011788.zip chromium_src-fda64c9e1866aff130c885c54431ee6b7d011788.tar.gz chromium_src-fda64c9e1866aff130c885c54431ee6b7d011788.tar.bz2 |
Revert of Shelf Cleanup (- binary files) (https://codereview.chromium.org/176883022/)
Reason for revert:
This cl is breaking the app list launch bubble. see crbug.com/351776.
Original issue's description:
> Shelf Cleanup (- binary files)
>
> R=skuhne@chromium.org
> TBR=jamescook@chromium.org, miket@chromium.org, skuhne@chromium.org
> BUG=338429
>
> re-landing of
> https://codereview.chromium.org/140323010/ hopefully this time with less breaking everything.
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256319
TBR=jamescook@chromium.org,skuhne@chromium.org,harrym@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=338429
Review URL: https://codereview.chromium.org/198063003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/dip_unittest.cc')
-rw-r--r-- | ash/dip_unittest.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ash/dip_unittest.cc b/ash/dip_unittest.cc index 41fc06e6..6c23910 100644 --- a/ash/dip_unittest.cc +++ b/ash/dip_unittest.cc @@ -69,4 +69,43 @@ TEST_F(DIPTest, WorkArea) { shelf->shelf_widget()->GetNativeView()->layer()->bounds().height()); } +TEST_F(DIPTest, WorkAreaForLegacyShelfLayout) { + CommandLine::ForCurrentProcess()->AppendSwitch( + ash::switches::kAshDisableAlternateShelfLayout); + UpdateDisplay("1000x900*1.0f"); + + aura::Window* root = Shell::GetPrimaryRootWindow(); + const gfx::Display display = + Shell::GetScreen()->GetDisplayNearestWindow(root); + + EXPECT_EQ("0,0 1000x900", display.bounds().ToString()); + gfx::Rect work_area = display.work_area(); + EXPECT_EQ("0,0 1000x852", work_area.ToString()); + EXPECT_EQ("0,0,48,0", display.bounds().InsetsFrom(work_area).ToString()); + + UpdateDisplay("2000x1800*2.0f"); + gfx::Screen* screen = Shell::GetScreen(); + + const gfx::Display display_2x = screen->GetDisplayNearestWindow(root); + const internal::DisplayInfo display_info_2x = + Shell::GetInstance()->display_manager()->GetDisplayInfo(display_2x.id()); + + // The |bounds_in_native()| should report bounds in pixel coordinate. + EXPECT_EQ("1,1 2000x1800", + display_info_2x.bounds_in_native().ToString()); + + // Aura and views coordinates are in DIP, so they their bounds do not change. + EXPECT_EQ("0,0 1000x900", display_2x.bounds().ToString()); + work_area = display_2x.work_area(); + EXPECT_EQ("0,0 1000x852", work_area.ToString()); + EXPECT_EQ("0,0,48,0", display_2x.bounds().InsetsFrom(work_area).ToString()); + + // Sanity check if the workarea's inset hight is same as + // the shelf's height. + Shelf* shelf = Shelf::ForPrimaryDisplay(); + EXPECT_EQ( + display_2x.bounds().InsetsFrom(work_area).height(), + shelf->shelf_widget()->GetNativeView()->layer()->bounds().height()); +} + } // namespace ash |