| 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/common/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 window->SetShowState(ui::SHOW_STATE_MINIMIZED); | 622 window->SetShowState(ui::SHOW_STATE_MINIMIZED); |
| 623 EXPECT_FALSE(window->IsVisible()); | 623 EXPECT_FALSE(window->IsVisible()); |
| 624 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, observer.GetShowStateAndReset()); | 624 EXPECT_EQ(ui::SHOW_STATE_MINIMIZED, observer.GetShowStateAndReset()); |
| 625 window->Show(); | 625 window->Show(); |
| 626 EXPECT_TRUE(window->IsVisible()); | 626 EXPECT_TRUE(window->IsVisible()); |
| 627 EXPECT_EQ(ui::SHOW_STATE_NORMAL, observer.GetShowStateAndReset()); | 627 EXPECT_EQ(ui::SHOW_STATE_NORMAL, observer.GetShowStateAndReset()); |
| 628 observer.SetWindow(nullptr); | 628 observer.SetWindow(nullptr); |
| 629 } | 629 } |
| 630 | 630 |
| 631 // Tests maximized window size during root window resize. | 631 // Tests maximized window size during root window resize. |
| 632 #if defined(OS_WIN) && !defined(USE_ASH) | 632 TEST_F(WorkspaceLayoutManagerSoloTest, MaximizeRootWindowResize) { |
| 633 // TODO(msw): Broken on Windows. http://crbug.com/584038 | |
| 634 #define MAYBE_MaximizeRootWindowResize DISABLED_MaximizeRootWindowResize | |
| 635 #else | |
| 636 #define MAYBE_MaximizeRootWindowResize MaximizeRootWindowResize | |
| 637 #endif | |
| 638 TEST_F(WorkspaceLayoutManagerSoloTest, MAYBE_MaximizeRootWindowResize) { | |
| 639 gfx::Rect bounds(100, 100, 200, 200); | 633 gfx::Rect bounds(100, 100, 200, 200); |
| 640 std::unique_ptr<WindowOwner> window_owner(CreateTestWindow(bounds)); | 634 std::unique_ptr<WindowOwner> window_owner(CreateTestWindow(bounds)); |
| 641 WmWindow* window = window_owner->window(); | 635 WmWindow* window = window_owner->window(); |
| 642 window->SetShowState(ui::SHOW_STATE_MAXIMIZED); | 636 window->SetShowState(ui::SHOW_STATE_MAXIMIZED); |
| 643 gfx::Rect initial_work_area_bounds = | 637 gfx::Rect initial_work_area_bounds = |
| 644 wm::GetMaximizedWindowBoundsInParent(window); | 638 wm::GetMaximizedWindowBoundsInParent(window); |
| 645 EXPECT_EQ(initial_work_area_bounds.ToString(), | 639 EXPECT_EQ(initial_work_area_bounds.ToString(), |
| 646 window->GetBounds().ToString()); | 640 window->GetBounds().ToString()); |
| 647 // Enlarge the root window. We should still match the work area size. | 641 // Enlarge the root window. We should still match the work area size. |
| 648 UpdateDisplay("900x700"); | 642 UpdateDisplay("900x700"); |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 changed_window_bounds.Offset(0, -shift); | 1320 changed_window_bounds.Offset(0, -shift); |
| 1327 // Window should be shifted up. | 1321 // Window should be shifted up. |
| 1328 EXPECT_EQ(changed_window_bounds, window->GetBounds()); | 1322 EXPECT_EQ(changed_window_bounds, window->GetBounds()); |
| 1329 | 1323 |
| 1330 kb_controller->HideKeyboard( | 1324 kb_controller->HideKeyboard( |
| 1331 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); | 1325 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); |
| 1332 EXPECT_EQ(orig_window_bounds, window->GetBounds()); | 1326 EXPECT_EQ(orig_window_bounds, window->GetBounds()); |
| 1333 } | 1327 } |
| 1334 | 1328 |
| 1335 } // namespace ash | 1329 } // namespace ash |
| OLD | NEW |