| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| 11 #include "ash/wm/window_properties.h" | 11 #include "ash/wm/window_properties.h" |
| 12 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/aura/client/activation_client.h" | 14 #include "ui/aura/client/activation_client.h" |
| 15 #include "ui/aura/root_window.h" | 15 #include "ui/aura/root_window.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/compositor/layer.h" | 17 #include "ui/compositor/layer.h" |
| 18 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
| 19 #include "ui/gfx/insets.h" | 19 #include "ui/gfx/insets.h" |
| 20 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| 21 #include "ui/views/corewm/shadow.h" | 21 #include "ui/views/corewm/shadow.h" |
| 22 #include "ui/views/corewm/shadow_controller.h" | 22 #include "ui/views/corewm/shadow_controller.h" |
| 23 #include "ui/views/corewm/shadow_types.h" | 23 #include "ui/views/corewm/shadow_types.h" |
| 24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 25 | 25 |
| 26 namespace ash { | 26 namespace ash { |
| 27 | 27 |
| 28 typedef ash::test::AshTestBase DIPTest; | 28 typedef ash::test::AshTestBase DIPTest; |
| 29 | 29 |
| 30 #if defined(OS_WIN) |
| 31 // Windows/Aura doesn't have DIP support in display yet. |
| 32 #define MAYBE_WorkArea DISABLED_WorkArea |
| 33 #else |
| 34 #define MAYBE_WorkArea WorkArea |
| 35 #endif |
| 36 |
| 30 // Test if the WM sets correct work area under different density. | 37 // Test if the WM sets correct work area under different density. |
| 31 TEST_F(DIPTest, WorkArea) { | 38 TEST_F(DIPTest, MAYBE_WorkArea) { |
| 32 ChangeDisplayConfig(1.0f, gfx::Rect(0, 0, 1000, 900)); | 39 ChangeDisplayConfig(1.0f, gfx::Rect(0, 0, 1000, 900)); |
| 33 | 40 |
| 34 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); | 41 aura::RootWindow* root = Shell::GetPrimaryRootWindow(); |
| 35 const gfx::Display display = | 42 const gfx::Display display = |
| 36 Shell::GetScreen()->GetDisplayNearestWindow(root); | 43 Shell::GetScreen()->GetDisplayNearestWindow(root); |
| 37 | 44 |
| 38 EXPECT_EQ("0,0 1000x900", display.bounds().ToString()); | 45 EXPECT_EQ("0,0 1000x900", display.bounds().ToString()); |
| 39 gfx::Rect work_area = display.work_area(); | 46 gfx::Rect work_area = display.work_area(); |
| 40 EXPECT_EQ("0,0 1000x852", work_area.ToString()); | 47 EXPECT_EQ("0,0 1000x852", work_area.ToString()); |
| 41 EXPECT_EQ("0,0,48,0", display.bounds().InsetsFrom(work_area).ToString()); | 48 EXPECT_EQ("0,0,48,0", display.bounds().InsetsFrom(work_area).ToString()); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 56 | 63 |
| 57 // Sanity check if the workarea's inset hight is same as | 64 // Sanity check if the workarea's inset hight is same as |
| 58 // the launcher's height. | 65 // the launcher's height. |
| 59 Launcher* launcher = Launcher::ForPrimaryDisplay(); | 66 Launcher* launcher = Launcher::ForPrimaryDisplay(); |
| 60 EXPECT_EQ( | 67 EXPECT_EQ( |
| 61 display_2x.bounds().InsetsFrom(work_area).height(), | 68 display_2x.bounds().InsetsFrom(work_area).height(), |
| 62 launcher->widget()->GetNativeView()->layer()->bounds().height()); | 69 launcher->widget()->GetNativeView()->layer()->bounds().height()); |
| 63 } | 70 } |
| 64 | 71 |
| 65 } // namespace ash | 72 } // namespace ash |
| OLD | NEW |