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" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 ChangeMonitorConfig(2.0f, gfx::Rect(0, 0, 1000, 1000)); | 56 ChangeMonitorConfig(2.0f, gfx::Rect(0, 0, 1000, 1000)); |
57 | 57 |
58 window.reset(new aura::Window(NULL)); | 58 window.reset(new aura::Window(NULL)); |
59 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 59 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
60 window->Init(ui::LAYER_TEXTURED); | 60 window->Init(ui::LAYER_TEXTURED); |
61 window->SetParent(NULL); | 61 window->SetParent(NULL); |
62 window->SetBounds(kBoundsInDIP); | 62 window->SetBounds(kBoundsInDIP); |
63 shadow = api.GetShadowForWindow(window.get()); | 63 shadow = api.GetShadowForWindow(window.get()); |
64 window->Show(); | 64 window->Show(); |
65 EXPECT_EQ("40,60 800x600", window->GetBoundsInPixel().ToString()); | 65 EXPECT_EQ("40,60 800x600", window->layer()->GetBoundsInPixel().ToString()); |
66 EXPECT_EQ(layer_bounds_copy.Scale(2.0f).ToString(), | 66 EXPECT_EQ(layer_bounds_copy.Scale(2.0f).ToString(), |
67 shadow->layer()->bounds().ToString()); | 67 shadow->layer()->bounds().ToString()); |
68 } | 68 } |
69 | 69 |
70 // Test if the WM sets correct work area under different density. | 70 // Test if the WM sets correct work area under different density. |
71 TEST_F(DIPTest, MAYBE_WorkArea) { | 71 TEST_F(DIPTest, MAYBE_WorkArea) { |
72 ChangeMonitorConfig(1.0f, gfx::Rect(0, 0, 1000, 900)); | 72 ChangeMonitorConfig(1.0f, gfx::Rect(0, 0, 1000, 900)); |
73 | 73 |
74 aura::RootWindow* root = Shell::GetRootWindow(); | 74 aura::RootWindow* root = Shell::GetRootWindow(); |
75 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(root); | 75 const gfx::Monitor monitor = gfx::Screen::GetMonitorNearestWindow(root); |
(...skipping 12 matching lines...) Expand all Loading... |
88 | 88 |
89 EXPECT_EQ(work_area.ToString(), monitor_2x.work_area().ToString()); | 89 EXPECT_EQ(work_area.ToString(), monitor_2x.work_area().ToString()); |
90 | 90 |
91 Launcher* launcher = Shell::GetInstance()->launcher(); | 91 Launcher* launcher = Shell::GetInstance()->launcher(); |
92 EXPECT_EQ( | 92 EXPECT_EQ( |
93 monitor_2x.bounds().InsetsFrom(work_area).height() * 2, | 93 monitor_2x.bounds().InsetsFrom(work_area).height() * 2, |
94 launcher->widget()->GetNativeView()->layer()->bounds().height()); | 94 launcher->widget()->GetNativeView()->layer()->bounds().height()); |
95 } | 95 } |
96 | 96 |
97 } // namespace ash | 97 } // namespace ash |
OLD | NEW |