| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 EXPECT_TRUE(shelf->GetDimsShelf()); | 940 EXPECT_TRUE(shelf->GetDimsShelf()); |
| 941 } | 941 } |
| 942 | 942 |
| 943 // Tests that entering overview when a fullscreen window is active in maximized | 943 // Tests that entering overview when a fullscreen window is active in maximized |
| 944 // mode correctly applies the transformations to the window and correctly | 944 // mode correctly applies the transformations to the window and correctly |
| 945 // updates the window bounds on exiting overview mode: http://crbug.com/401664. | 945 // updates the window bounds on exiting overview mode: http://crbug.com/401664. |
| 946 TEST_P(WindowSelectorTest, FullscreenWindowMaximizeMode) { | 946 TEST_P(WindowSelectorTest, FullscreenWindowMaximizeMode) { |
| 947 gfx::Rect bounds(0, 0, 400, 400); | 947 gfx::Rect bounds(0, 0, 400, 400); |
| 948 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); | 948 std::unique_ptr<aura::Window> window1(CreateWindow(bounds)); |
| 949 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); | 949 std::unique_ptr<aura::Window> window2(CreateWindow(bounds)); |
| 950 Shell::GetInstance() | 950 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 951 ->maximize_mode_controller() | 951 true); |
| 952 ->EnableMaximizeModeWindowManager(true); | |
| 953 wm::ActivateWindow(window2.get()); | 952 wm::ActivateWindow(window2.get()); |
| 954 wm::ActivateWindow(window1.get()); | 953 wm::ActivateWindow(window1.get()); |
| 955 gfx::Rect normal_window_bounds(window1->bounds()); | 954 gfx::Rect normal_window_bounds(window1->bounds()); |
| 956 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); | 955 const wm::WMEvent toggle_fullscreen_event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
| 957 wm::GetWindowState(window1.get())->OnWMEvent(&toggle_fullscreen_event); | 956 wm::GetWindowState(window1.get())->OnWMEvent(&toggle_fullscreen_event); |
| 958 gfx::Rect fullscreen_window_bounds(window1->bounds()); | 957 gfx::Rect fullscreen_window_bounds(window1->bounds()); |
| 959 EXPECT_NE(normal_window_bounds.ToString(), | 958 EXPECT_NE(normal_window_bounds.ToString(), |
| 960 fullscreen_window_bounds.ToString()); | 959 fullscreen_window_bounds.ToString()); |
| 961 EXPECT_EQ(fullscreen_window_bounds.ToString(), | 960 EXPECT_EQ(fullscreen_window_bounds.ToString(), |
| 962 window2->GetTargetBounds().ToString()); | 961 window2->GetTargetBounds().ToString()); |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1823 bounds.y()); | 1822 bounds.y()); |
| 1824 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); | 1823 EXPECT_LE(transformed_rect.bottom(), bounds.bottom()); |
| 1825 EXPECT_NEAR(transformed_rect.x() - bounds.x(), | 1824 EXPECT_NEAR(transformed_rect.x() - bounds.x(), |
| 1826 bounds.right() - transformed_rect.right(), 1); | 1825 bounds.right() - transformed_rect.right(), 1); |
| 1827 EXPECT_NEAR( | 1826 EXPECT_NEAR( |
| 1828 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), | 1827 transformed_rect.y() + (int)(scale * inset) - header_height - bounds.y(), |
| 1829 bounds.bottom() - transformed_rect.bottom(), 1); | 1828 bounds.bottom() - transformed_rect.bottom(), 1); |
| 1830 } | 1829 } |
| 1831 | 1830 |
| 1832 } // namespace ash | 1831 } // namespace ash |
| OLD | NEW |