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 "ash/wm/workspace/workspace_manager.h" | 5 #include "ash/wm/workspace/workspace_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 w1->Show(); | 168 w1->Show(); |
169 | 169 |
170 ASSERT_TRUE(w1->layer() != NULL); | 170 ASSERT_TRUE(w1->layer() != NULL); |
171 EXPECT_TRUE(w1->layer()->visible()); | 171 EXPECT_TRUE(w1->layer()->visible()); |
172 | 172 |
173 EXPECT_EQ(250, w1->bounds().width()); | 173 EXPECT_EQ(250, w1->bounds().width()); |
174 EXPECT_EQ(251, w1->bounds().height()); | 174 EXPECT_EQ(251, w1->bounds().height()); |
175 | 175 |
176 // Maximize the window. | 176 // Maximize the window. |
177 Shell::GetInstance()->SetScreenWorkAreaInsets( | 177 Shell::GetInstance()->SetMonitorWorkAreaInsets( |
178 gfx::Insets(0, 0, 30, 0)); | 178 Shell::GetRootWindow(), |
| 179 gfx::Insets(0, 0, 30, 0)); |
179 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); | 180 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
180 | 181 |
181 // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the work area bounds. | 182 // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the work area bounds. |
182 ASSERT_EQ(1u, workspaces().size()); | 183 ASSERT_EQ(1u, workspaces().size()); |
183 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type()); | 184 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type()); |
184 ASSERT_EQ(1u, workspaces()[0]->windows().size()); | 185 ASSERT_EQ(1u, workspaces()[0]->windows().size()); |
185 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]); | 186 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]); |
186 EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width()); | 187 EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width()); |
187 EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height()); | 188 EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height()); |
188 | 189 |
189 // Change work area insets. | 190 // Change work area insets. |
190 Shell::GetInstance()->SetScreenWorkAreaInsets( | 191 Shell::GetInstance()->SetMonitorWorkAreaInsets( |
191 gfx::Insets(0, 0, 60, 0)); | 192 Shell::GetRootWindow(), |
| 193 gfx::Insets(0, 0, 60, 0)); |
192 | 194 |
193 // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the changed work | 195 // Should be 1 workspace, TYPE_MAXIMIZED with w1, fills the changed work |
194 // area bounds. | 196 // area bounds. |
195 ASSERT_EQ(1u, workspaces().size()); | 197 ASSERT_EQ(1u, workspaces().size()); |
196 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type()); | 198 EXPECT_EQ(Workspace::TYPE_MAXIMIZED, workspaces()[0]->type()); |
197 ASSERT_EQ(1u, workspaces()[0]->windows().size()); | 199 ASSERT_EQ(1u, workspaces()[0]->windows().size()); |
198 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]); | 200 EXPECT_EQ(w1.get(), workspaces()[0]->windows()[0]); |
199 EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width()); | 201 EXPECT_EQ(GetWorkAreaBounds().width(), w1->bounds().width()); |
200 EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height()); | 202 EXPECT_EQ(GetWorkAreaBounds().height(), w1->bounds().height()); |
201 } | 203 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 EXPECT_TRUE(w3->layer()->IsDrawn()); | 413 EXPECT_TRUE(w3->layer()->IsDrawn()); |
412 | 414 |
413 w1->Show(); | 415 w1->Show(); |
414 EXPECT_TRUE(w1->layer()->IsDrawn()); | 416 EXPECT_TRUE(w1->layer()->IsDrawn()); |
415 EXPECT_FALSE(w2->layer()->IsDrawn()); | 417 EXPECT_FALSE(w2->layer()->IsDrawn()); |
416 EXPECT_FALSE(w3->layer()->IsDrawn()); | 418 EXPECT_FALSE(w3->layer()->IsDrawn()); |
417 } | 419 } |
418 | 420 |
419 } // namespace internal | 421 } // namespace internal |
420 } // namespace ash | 422 } // namespace ash |
OLD | NEW |