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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 } | 299 } |
300 | 300 |
301 // Assertions around grid size. | 301 // Assertions around grid size. |
302 TEST_F(WorkspaceManagerTest, SnapToGrid) { | 302 TEST_F(WorkspaceManagerTest, SnapToGrid) { |
303 manager_->set_grid_size(8); | 303 manager_->set_grid_size(8); |
304 | 304 |
305 // Verify snap to grid when bounds are set before parented. | 305 // Verify snap to grid when bounds are set before parented. |
306 scoped_ptr<Window> w1(CreateTestWindowUnparented()); | 306 scoped_ptr<Window> w1(CreateTestWindowUnparented()); |
307 w1->SetBounds(gfx::Rect(1, 6, 25, 30)); | 307 w1->SetBounds(gfx::Rect(1, 6, 25, 30)); |
308 w1->SetParent(GetViewport()); | 308 w1->SetParent(GetViewport()); |
309 EXPECT_EQ(gfx::Rect(0, 8, 24, 32), w1->bounds()); | 309 // We are not aligning this anymore this way. When the window gets shown |
| 310 // the window is expected to be handled differently, but this cannot be |
| 311 // tested with this test. So the result of this test should be that the |
| 312 // bounds are exactly as passed in. |
| 313 EXPECT_EQ(gfx::Rect(1, 6, 25, 30), w1->bounds()); |
310 } | 314 } |
311 | 315 |
312 // Assertions around a fullscreen window. | 316 // Assertions around a fullscreen window. |
313 TEST_F(WorkspaceManagerTest, SingleFullscreenWindow) { | 317 TEST_F(WorkspaceManagerTest, SingleFullscreenWindow) { |
314 scoped_ptr<Window> w1(CreateTestWindow()); | 318 scoped_ptr<Window> w1(CreateTestWindow()); |
315 w1->SetBounds(gfx::Rect(0, 0, 250, 251)); | 319 w1->SetBounds(gfx::Rect(0, 0, 250, 251)); |
316 // Make the window fullscreen. | 320 // Make the window fullscreen. |
317 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 321 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
318 w1->Show(); | 322 w1->Show(); |
319 | 323 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 w1->Show(); | 582 w1->Show(); |
579 wm::ActivateWindow(w1.get()); | 583 wm::ActivateWindow(w1.get()); |
580 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); | 584 w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); |
581 EXPECT_FALSE(w1->IsVisible()); | 585 EXPECT_FALSE(w1->IsVisible()); |
582 w1->Show(); | 586 w1->Show(); |
583 EXPECT_TRUE(w1->IsVisible()); | 587 EXPECT_TRUE(w1->IsVisible()); |
584 } | 588 } |
585 | 589 |
586 } // namespace internal | 590 } // namespace internal |
587 } // namespace ash | 591 } // namespace ash |
OLD | NEW |