| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dock/docked_window_resizer.h" | 5 #include "ash/wm/dock/docked_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 wm::WindowState* window_state = wm::GetWindowState(window.get()); | 502 wm::WindowState* window_state = wm::GetWindowState(window.get()); |
| 503 // Minimize the window, it should be hidden. | 503 // Minimize the window, it should be hidden. |
| 504 window_state->Minimize(); | 504 window_state->Minimize(); |
| 505 RunAllPendingInMessageLoop(); | 505 RunAllPendingInMessageLoop(); |
| 506 EXPECT_FALSE(window->IsVisible()); | 506 EXPECT_FALSE(window->IsVisible()); |
| 507 EXPECT_TRUE(window_state->IsMinimized()); | 507 EXPECT_TRUE(window_state->IsMinimized()); |
| 508 // Restore the window; window should be visible. | 508 // Restore the window; window should be visible. |
| 509 window_state->Restore(); | 509 window_state->Restore(); |
| 510 RunAllPendingInMessageLoop(); | 510 RunAllPendingInMessageLoop(); |
| 511 EXPECT_TRUE(window->IsVisible()); | 511 EXPECT_TRUE(window->IsVisible()); |
| 512 EXPECT_TRUE(window_state->IsNormalStateType()); | 512 EXPECT_TRUE(window_state->IsDocked()); |
| 513 } | 513 } |
| 514 | 514 |
| 515 // Maximize a docked window and check that it is maximized and no longer docked. | 515 // Maximize a docked window and check that it is maximized and no longer docked. |
| 516 TEST_P(DockedWindowResizerTest, AttachMaximize) { | 516 TEST_P(DockedWindowResizerTest, AttachMaximize) { |
| 517 if (!SupportsHostWindowResize()) | 517 if (!SupportsHostWindowResize()) |
| 518 return; | 518 return; |
| 519 | 519 |
| 520 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); | 520 scoped_ptr<aura::Window> window(CreateTestWindow(gfx::Rect(0, 0, 201, 201))); |
| 521 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); | 521 DragRelativeToEdge(DOCKED_EDGE_RIGHT, window.get(), 0); |
| 522 | 522 |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 EXPECT_TRUE(window_state->IsMaximized()); | 1604 EXPECT_TRUE(window_state->IsMaximized()); |
| 1605 } | 1605 } |
| 1606 | 1606 |
| 1607 // Tests run twice - on both panels and normal windows | 1607 // Tests run twice - on both panels and normal windows |
| 1608 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 1608 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
| 1609 DockedWindowResizerTest, | 1609 DockedWindowResizerTest, |
| 1610 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 1610 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 1611 ui::wm::WINDOW_TYPE_PANEL)); | 1611 ui::wm::WINDOW_TYPE_PANEL)); |
| 1612 | 1612 |
| 1613 } // namespace ash | 1613 } // namespace ash |
| OLD | NEW |