Index: ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc |
diff --git a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc |
similarity index 86% |
rename from ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc |
rename to ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc |
index 53816512df274736d19ba4f5e45f3c12310cd683..4413dc5826a6610b909fde858a00aa88edcf2130 100644 |
--- a/ash/wm/maximize_mode/maximize_mode_window_manager_unittest.cc |
+++ b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
+#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" |
#include <string> |
@@ -15,10 +15,10 @@ |
#include "ash/shell_port.h" |
#include "ash/test/ash_test_base.h" |
#include "ash/test/shell_test_api.h" |
-#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
#include "ash/wm/mru_window_tracker.h" |
#include "ash/wm/overview/window_selector_controller.h" |
#include "ash/wm/switchable_windows.h" |
+#include "ash/wm/tablet_mode/tablet_mode_controller.h" |
#include "ash/wm/window_properties.h" |
#include "ash/wm/window_state.h" |
#include "ash/wm/window_state_observer.h" |
@@ -40,10 +40,10 @@ |
namespace ash { |
-class MaximizeModeWindowManagerTest : public test::AshTestBase { |
+class TabletModeWindowManagerTest : public test::AshTestBase { |
public: |
- MaximizeModeWindowManagerTest() {} |
- ~MaximizeModeWindowManagerTest() override {} |
+ TabletModeWindowManagerTest() {} |
+ ~TabletModeWindowManagerTest() override {} |
// Creates a window which has a fixed size. |
aura::Window* CreateFixedSizeNonMaximizableWindow( |
@@ -85,25 +85,24 @@ class MaximizeModeWindowManagerTest : public test::AshTestBase { |
} |
// Create the Maximized mode window manager. |
- MaximizeModeWindowManager* CreateMaximizeModeWindowManager() { |
- EXPECT_FALSE(maximize_mode_window_manager()); |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
- true); |
- return maximize_mode_window_manager(); |
+ TabletModeWindowManager* CreateTabletModeWindowManager() { |
+ EXPECT_FALSE(tablet_mode_window_manager()); |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); |
+ return tablet_mode_window_manager(); |
} |
- // Destroy the maximized mode window manager. |
- void DestroyMaximizeModeWindowManager() { |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
+ // Destroy the tablet mode window manager. |
+ void DestroyTabletModeWindowManager() { |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager( |
false); |
- EXPECT_FALSE(maximize_mode_window_manager()); |
+ EXPECT_FALSE(tablet_mode_window_manager()); |
} |
// Get the maximze window manager. |
- MaximizeModeWindowManager* maximize_mode_window_manager() { |
+ TabletModeWindowManager* tablet_mode_window_manager() { |
return Shell::Get() |
- ->maximize_mode_controller() |
- ->maximize_mode_window_manager_.get(); |
+ ->tablet_mode_controller() |
+ ->tablet_mode_window_manager_.get(); |
} |
// Resize our desktop. |
@@ -118,7 +117,7 @@ class MaximizeModeWindowManagerTest : public test::AshTestBase { |
private: |
// Create a window in one of the containers which are watched by the |
- // MaximizeModeWindowManager. Note that this only works with one root window. |
+ // TabletModeWindowManager. Note that this only works with one root window. |
// If |can_maximize| is not set, |max_size| is the upper limiting size for |
// the window, whereas an empty size means that there is no limit. |
aura::Window* CreateWindowInWatchedContainer(aura::client::WindowType type, |
@@ -145,21 +144,21 @@ class MaximizeModeWindowManagerTest : public test::AshTestBase { |
return window; |
} |
- DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManagerTest); |
+ DISALLOW_COPY_AND_ASSIGN(TabletModeWindowManagerTest); |
}; |
// Test that creating the object and destroying it without any windows should |
// not cause any problems. |
-TEST_F(MaximizeModeWindowManagerTest, SimpleStart) { |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+TEST_F(TabletModeWindowManagerTest, SimpleStart) { |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that existing windows will handled properly when going into maximized |
// mode. |
-TEST_F(MaximizeModeWindowManagerTest, PreCreateWindows) { |
+TEST_F(TabletModeWindowManagerTest, PreCreateWindows) { |
// Bounds for windows we know can be controlled. |
gfx::Rect rect1(10, 10, 200, 50); |
gfx::Rect rect2(10, 60, 200, 50); |
@@ -191,7 +190,7 @@ TEST_F(MaximizeModeWindowManagerTest, PreCreateWindows) { |
// Create the manager and make sure that all qualifying windows were detected |
// and changed. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); |
EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMaximized()); |
@@ -214,7 +213,7 @@ TEST_F(MaximizeModeWindowManagerTest, PreCreateWindows) { |
// Destroy the manager again and check that the windows return to their |
// previous state. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); |
@@ -229,7 +228,7 @@ TEST_F(MaximizeModeWindowManagerTest, PreCreateWindows) { |
} |
// The same test as the above but while a system modal dialog is shown. |
-TEST_F(MaximizeModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { |
+TEST_F(TabletModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { |
// Bounds for windows we know can be controlled. |
gfx::Rect rect1(10, 10, 200, 50); |
gfx::Rect rect2(10, 60, 200, 50); |
@@ -265,7 +264,7 @@ TEST_F(MaximizeModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { |
// Create the manager and make sure that all qualifying windows were detected |
// and changed. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); |
EXPECT_TRUE(wm::GetWindowState(w1.get())->IsMaximized()); |
@@ -288,7 +287,7 @@ TEST_F(MaximizeModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { |
// Destroy the manager again and check that the windows return to their |
// previous state. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); |
@@ -303,8 +302,8 @@ TEST_F(MaximizeModeWindowManagerTest, GoingToMaximizedWithModalDialogPresent) { |
} |
// Test that non-maximizable windows get properly handled when going into |
-// maximized mode. |
-TEST_F(MaximizeModeWindowManagerTest, |
+// tablet mode. |
+TEST_F(TabletModeWindowManagerTest, |
PreCreateNonMaximizableButResizableWindows) { |
// The window bounds. |
gfx::Rect rect(10, 10, 200, 50); |
@@ -330,7 +329,7 @@ TEST_F(MaximizeModeWindowManagerTest, |
// Create the manager and make sure that all qualifying windows were detected |
// and changed. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); |
// The unlimited window should have the size of the workspace / parent window. |
@@ -351,7 +350,7 @@ TEST_F(MaximizeModeWindowManagerTest, |
// Destroy the manager again and check that the windows return to their |
// previous state. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(unlimited_window.get())->IsMaximized()); |
EXPECT_EQ(rect.ToString(), unlimited_window->bounds().ToString()); |
EXPECT_FALSE(wm::GetWindowState(limited_window.get())->IsMaximized()); |
@@ -361,8 +360,8 @@ TEST_F(MaximizeModeWindowManagerTest, |
} |
// Test that creating windows while a maximizer exists picks them properly up. |
-TEST_F(MaximizeModeWindowManagerTest, CreateWindows) { |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+TEST_F(TabletModeWindowManagerTest, CreateWindows) { |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
@@ -416,9 +415,9 @@ TEST_F(MaximizeModeWindowManagerTest, CreateWindows) { |
EXPECT_EQ(rect.ToString(), w7->bounds().ToString()); |
EXPECT_EQ(rect.ToString(), w8->bounds().ToString()); |
- // After the maximize mode was disabled all windows fall back into the mode |
+ // After the tablet mode was disabled all windows fall back into the mode |
// they were created for. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); |
@@ -432,11 +431,11 @@ TEST_F(MaximizeModeWindowManagerTest, CreateWindows) { |
EXPECT_EQ(rect.ToString(), w8->bounds().ToString()); |
} |
-// Test that a window which got created while the maximize mode window manager |
+// Test that a window which got created while the tablet mode window manager |
// is active gets restored to a usable (non tiny) size upon switching back. |
-TEST_F(MaximizeModeWindowManagerTest, |
+TEST_F(TabletModeWindowManagerTest, |
CreateWindowInMaximizedModeRestoresToUsefulSize) { |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
@@ -449,20 +448,20 @@ TEST_F(MaximizeModeWindowManagerTest, |
EXPECT_NE(empty_rect.ToString(), window->bounds().ToString()); |
gfx::Rect maximized_size = window->bounds(); |
- // Destroy the maximize mode and check that the resulting size of the window |
+ // Destroy the tablet mode and check that the resulting size of the window |
// is remaining as it is (but not maximized). |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
EXPECT_EQ(maximized_size.ToString(), window->bounds().ToString()); |
} |
// Test that non-maximizable windows get properly handled when created in |
-// maximized mode. |
-TEST_F(MaximizeModeWindowManagerTest, CreateNonMaximizableButResizableWindows) { |
+// tablet mode. |
+TEST_F(TabletModeWindowManagerTest, CreateNonMaximizableButResizableWindows) { |
// Create the manager and make sure that all qualifying windows were detected |
// and changed. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
gfx::Rect rect(10, 10, 200, 50); |
@@ -500,7 +499,7 @@ TEST_F(MaximizeModeWindowManagerTest, CreateNonMaximizableButResizableWindows) { |
// Destroy the manager again and check that the windows return to their |
// creation state. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(unlimited_window.get())->IsMaximized()); |
EXPECT_EQ(rect.ToString(), unlimited_window->bounds().ToString()); |
@@ -531,7 +530,7 @@ std::string GetPlacementOverride(aura::Window* window) { |
// Test that the restore state will be kept at its original value for |
// session restauration purposes. |
-TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { |
+TEST_F(TabletModeWindowManagerTest, TestRestoreIntegrety) { |
gfx::Rect bounds(10, 10, 200, 50); |
gfx::Size empty_size; |
gfx::Rect empty_bounds; |
@@ -543,7 +542,7 @@ TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { |
EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); |
EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
// With the maximization the override states should be returned in its |
@@ -559,7 +558,7 @@ TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { |
GetPlacementOverride(maximized_window.get())); |
// Destroy the manager again and check that the overrides get reset. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_EQ(std::string(), GetPlacementOverride(normal_window.get())); |
EXPECT_EQ(std::string(), GetPlacementOverride(maximized_window.get())); |
@@ -573,8 +572,8 @@ TEST_F(MaximizeModeWindowManagerTest, TestRestoreIntegrety) { |
// Test that windows which got created before the maximizer was created can be |
// destroyed while the maximizer is still running. |
-TEST_F(MaximizeModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { |
- MaximizeModeWindowManager* manager = NULL; |
+TEST_F(TabletModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { |
+ TabletModeWindowManager* manager = NULL; |
{ |
// Bounds for windows we know can be controlled. |
gfx::Rect rect1(10, 10, 200, 50); |
@@ -591,18 +590,18 @@ TEST_F(MaximizeModeWindowManagerTest, PreCreateWindowsDeleteWhileActive) { |
// Create the manager and make sure that all qualifying windows were |
// detected and changed. |
- manager = CreateMaximizeModeWindowManager(); |
+ manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); |
} |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that windows which got created while the maximizer was running can get |
// destroyed before the maximizer gets destroyed. |
-TEST_F(MaximizeModeWindowManagerTest, CreateWindowsAndDeleteWhileActive) { |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+TEST_F(TabletModeWindowManagerTest, CreateWindowsAndDeleteWhileActive) { |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
{ |
@@ -623,11 +622,11 @@ TEST_F(MaximizeModeWindowManagerTest, CreateWindowsAndDeleteWhileActive) { |
EXPECT_FALSE(wm::GetWindowState(w3.get())->IsMaximized()); |
} |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that windows which were maximized stay maximized. |
-TEST_F(MaximizeModeWindowManagerTest, MaximizedShouldRemainMaximized) { |
+TEST_F(TabletModeWindowManagerTest, MaximizedShouldRemainMaximized) { |
// Bounds for windows we know can be controlled. |
gfx::Rect rect(10, 10, 200, 50); |
std::unique_ptr<aura::Window> window( |
@@ -635,22 +634,22 @@ TEST_F(MaximizeModeWindowManagerTest, MaximizedShouldRemainMaximized) { |
wm::GetWindowState(window.get())->Maximize(); |
// Create the manager and make sure that the window gets detected. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(1, manager->GetNumberOfManagedWindows()); |
EXPECT_TRUE(wm::GetWindowState(window.get())->IsMaximized()); |
// Destroy the manager again and check that the window will remain maximized. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(wm::GetWindowState(window.get())->IsMaximized()); |
wm::GetWindowState(window.get())->Restore(); |
EXPECT_EQ(rect.ToString(), window->bounds().ToString()); |
} |
// Test that minimized windows do neither get maximized nor restored upon |
-// entering maximized mode and get restored to their previous state after |
+// entering tablet mode and get restored to their previous state after |
// leaving. |
-TEST_F(MaximizeModeWindowManagerTest, MinimizedWindowBehavior) { |
+TEST_F(TabletModeWindowManagerTest, MinimizedWindowBehavior) { |
// Bounds for windows we know can be controlled. |
gfx::Rect rect(10, 10, 200, 50); |
std::unique_ptr<aura::Window> initially_minimized_window( |
@@ -663,7 +662,7 @@ TEST_F(MaximizeModeWindowManagerTest, MinimizedWindowBehavior) { |
wm::GetWindowState(initially_maximized_window.get())->Maximize(); |
// Create the manager and make sure that the window gets detected. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(3, manager->GetNumberOfManagedWindows()); |
EXPECT_TRUE( |
@@ -682,7 +681,7 @@ TEST_F(MaximizeModeWindowManagerTest, MinimizedWindowBehavior) { |
wm::GetWindowState(initially_maximized_window.get())->IsMinimized()); |
// Destroy the manager again and check that the window will get minimized. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE( |
wm::GetWindowState(initially_minimized_window.get())->IsMinimized()); |
EXPECT_FALSE( |
@@ -693,7 +692,7 @@ TEST_F(MaximizeModeWindowManagerTest, MinimizedWindowBehavior) { |
// Check that resizing the desktop does reposition unmaximizable, unresizable & |
// managed windows. |
-TEST_F(MaximizeModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { |
+TEST_F(TabletModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { |
UpdateDisplay("400x400"); |
// This window will move because it does not fit the new bounds. |
gfx::Rect rect(20, 300, 100, 100); |
@@ -707,7 +706,7 @@ TEST_F(MaximizeModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { |
aura::client::WINDOW_TYPE_NORMAL, rect2)); |
// Turning on the manager will reposition (but not resize) the window. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(2, manager->GetNumberOfManagedWindows()); |
gfx::Rect moved_bounds(window1->bounds()); |
@@ -723,20 +722,20 @@ TEST_F(MaximizeModeWindowManagerTest, DesktopSizeChangeMovesUnmaximizable) { |
// Turning off the mode should not restore to the initial coordinates since |
// the new resolution is smaller and the window was on the edge. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_NE(rect.ToString(), window1->bounds().ToString()); |
EXPECT_EQ(rect2.ToString(), window2->bounds().ToString()); |
} |
// Check that windows return to original location if desktop size changes to |
-// something else and back while in maximize mode. |
-TEST_F(MaximizeModeWindowManagerTest, SizeChangeReturnWindowToOriginalPos) { |
+// something else and back while in tablet mode. |
+TEST_F(TabletModeWindowManagerTest, SizeChangeReturnWindowToOriginalPos) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> window(CreateFixedSizeNonMaximizableWindow( |
aura::client::WINDOW_TYPE_NORMAL, rect)); |
// Turning on the manager will reposition (but not resize) the window. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(1, manager->GetNumberOfManagedWindows()); |
gfx::Rect moved_bounds(window->bounds()); |
@@ -751,15 +750,15 @@ TEST_F(MaximizeModeWindowManagerTest, SizeChangeReturnWindowToOriginalPos) { |
EXPECT_NE(moved_bounds.origin().ToString(), new_moved_bounds.ToString()); |
// Then resize back to the original desktop size which should move windows |
- // to their original location after leaving the maximize mode. |
+ // to their original location after leaving the tablet mode. |
ResizeDesktop(10); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_EQ(rect.ToString(), window->bounds().ToString()); |
} |
-// Check that enabling of the maximize mode does not have an impact on the MRU |
+// Check that enabling of the tablet mode does not have an impact on the MRU |
// order of windows. |
-TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) { |
+TEST_F(TabletModeWindowManagerTest, ModeChangeKeepsMRUOrder) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1(CreateFixedSizeNonMaximizableWindow( |
aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -785,7 +784,7 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) { |
} |
// Activating the window manager should keep the order. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(5, manager->GetNumberOfManagedWindows()); |
{ |
@@ -800,7 +799,7 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) { |
} |
// Destroying should still keep the order. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
{ |
aura::Window::Windows windows = |
Shell::Get()->mru_window_tracker()->BuildMruWindowList(); |
@@ -814,12 +813,12 @@ TEST_F(MaximizeModeWindowManagerTest, ModeChangeKeepsMRUOrder) { |
} |
// Check that a restore state change does always restore to maximized. |
-TEST_F(MaximizeModeWindowManagerTest, IgnoreRestoreStateChages) { |
+TEST_F(TabletModeWindowManagerTest, IgnoreRestoreStateChages) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
wm::WindowState* window_state = wm::GetWindowState(w1.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsMaximized()); |
window_state->Minimize(); |
EXPECT_TRUE(window_state->IsMinimized()); |
@@ -827,18 +826,17 @@ TEST_F(MaximizeModeWindowManagerTest, IgnoreRestoreStateChages) { |
EXPECT_TRUE(window_state->IsMaximized()); |
window_state->Restore(); |
EXPECT_TRUE(window_state->IsMaximized()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Check that minimize and restore do the right thing. |
-TEST_F(MaximizeModeWindowManagerTest, TestMinimize) { |
+TEST_F(TabletModeWindowManagerTest, TestMinimize) { |
gfx::Rect rect(10, 10, 100, 100); |
std::unique_ptr<aura::Window> window( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
wm::WindowState* window_state = wm::GetWindowState(window.get()); |
EXPECT_EQ(rect.ToString(), window->bounds().ToString()); |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
- true); |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); |
EXPECT_TRUE(window_state->IsMaximized()); |
EXPECT_FALSE(window_state->IsMinimized()); |
EXPECT_TRUE(window->IsVisible()); |
@@ -853,8 +851,7 @@ TEST_F(MaximizeModeWindowManagerTest, TestMinimize) { |
EXPECT_FALSE(window_state->IsMinimized()); |
EXPECT_TRUE(window->IsVisible()); |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
- false); |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); |
EXPECT_FALSE(window_state->IsMaximized()); |
EXPECT_FALSE(window_state->IsMinimized()); |
EXPECT_TRUE(window->IsVisible()); |
@@ -862,8 +859,8 @@ TEST_F(MaximizeModeWindowManagerTest, TestMinimize) { |
// Check that a full screen window remains full screen upon entering maximize |
// mode. Furthermore, checks that this window is not full screen upon exiting |
-// maximize mode if it was un-full-screened while in maximize mode. |
-TEST_F(MaximizeModeWindowManagerTest, KeepFullScreenModeOn) { |
+// tablet mode if it was un-full-screened while in tablet mode. |
+TEST_F(TabletModeWindowManagerTest, KeepFullScreenModeOn) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -882,32 +879,32 @@ TEST_F(MaximizeModeWindowManagerTest, KeepFullScreenModeOn) { |
EXPECT_TRUE(window_state->IsFullscreen()); |
EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// The Full screen mode should continue to be on. |
EXPECT_TRUE(window_state->IsFullscreen()); |
EXPECT_FALSE(window_state->IsMaximized()); |
EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); |
- // With leaving the fullscreen mode, the maximized mode should return and the |
- // shelf should maintain its state from before maximize mode. |
+ // With leaving the fullscreen mode, the tablet mode should return and the |
+ // shelf should maintain its state from before tablet mode. |
window_state->OnWMEvent(&event); |
EXPECT_FALSE(window_state->IsFullscreen()); |
EXPECT_TRUE(window_state->IsMaximized()); |
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
- // We left fullscreen mode while in maximize mode, so the window should |
+ // We left fullscreen mode while in tablet mode, so the window should |
// remain maximized and the shelf should not change state upon exiting |
- // maximize mode. |
- DestroyMaximizeModeWindowManager(); |
+ // tablet mode. |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsFullscreen()); |
EXPECT_TRUE(window_state->IsMaximized()); |
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
} |
// Similar to the fullscreen mode, the pinned mode should be kept as well. |
-TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case1) { |
- // Scenario: in the default state, pin a window, enter to the maximized mode, |
+TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case1) { |
+ // Scenario: in the default state, pin a window, enter to the tablet mode, |
// then unpin. |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
@@ -924,7 +921,7 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case1) { |
// Enter to Maximized mode. |
// The pinned mode should continue to be on. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Then unpin. |
@@ -933,12 +930,12 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case1) { |
// Exit from Maximized mode. |
// The window should not be back to the pinned mode. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
} |
-TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case2) { |
- // Scenario: in the maximized mode, pin a window, exit from the maximized |
+TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case2) { |
+ // Scenario: in the tablet mode, pin a window, exit from the maximized |
// mode, then unpin. |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
@@ -947,7 +944,7 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case2) { |
EXPECT_FALSE(window_state->IsPinned()); |
// Enter to Maximized mode. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
// Pin the window. |
@@ -959,7 +956,7 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case2) { |
// Exit from Maximized mode. |
// The pinned mode should continue to be on. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Then unpin. |
@@ -968,17 +965,17 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case2) { |
// Enter again to Maximized mode for verification. |
// The window should not be back to the pinned mode. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
// Exit from Maximized mode. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
} |
-TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case3) { |
- // Scenario: in the default state, pin a window, enter to the maximized mode, |
- // exit from the maximized mode, then unpin. |
+TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case3) { |
+ // Scenario: in the default state, pin a window, enter to the tablet mode, |
+ // exit from the tablet mode, then unpin. |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -994,12 +991,12 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case3) { |
// Enter to Maximized mode. |
// The pinned mode should continue to be on. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Exit from Maximized mode. |
// The pinned mode should continue to be on, too. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Then unpin. |
@@ -1008,16 +1005,16 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case3) { |
// Enter again to Maximized mode for verification. |
// The window should not be back to the pinned mode. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
// Exit from Maximized mode. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
-TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case4) { |
- // Scenario: in the maximized mode, pin a window, exit from the maximized |
- // mode, enter back to the maximized mode, then unpin. |
+TEST_F(TabletModeWindowManagerTest, KeepPinnedModeOn_Case4) { |
+ // Scenario: in the tablet mode, pin a window, exit from the maximized |
+ // mode, enter back to the tablet mode, then unpin. |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1025,7 +1022,7 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case4) { |
EXPECT_FALSE(window_state->IsPinned()); |
// Enter to Maximized mode. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
// Pin the window. |
@@ -1037,12 +1034,12 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case4) { |
// Exit from Maximized mode. |
// The pinned mode should continue to be on. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Enter again to Maximized mode. |
// The pinned mode should continue to be on, too. |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsPinned()); |
// Then unpin. |
@@ -1051,14 +1048,14 @@ TEST_F(MaximizeModeWindowManagerTest, KeepPinnedModeOn_Case4) { |
// Exit from Maximized mode. |
// The window should not be back to the pinned mode. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsPinned()); |
} |
-// Verifies that if a window is un-full-screened while in maximize mode, |
+// Verifies that if a window is un-full-screened while in tablet mode, |
// other changes to that window's state (such as minimizing it) are |
-// preserved upon exiting maximize mode. |
-TEST_F(MaximizeModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) { |
+// preserved upon exiting tablet mode. |
+TEST_F(TabletModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1072,20 +1069,20 @@ TEST_F(MaximizeModeWindowManagerTest, MinimizePreservedAfterLeavingFullscreen) { |
window_state->OnWMEvent(&event); |
ASSERT_FALSE(window_state->IsMinimized()); |
- // Enter maximize mode, exit full screen, and then minimize the window. |
- CreateMaximizeModeWindowManager(); |
+ // Enter tablet mode, exit full screen, and then minimize the window. |
+ CreateTabletModeWindowManager(); |
window_state->OnWMEvent(&event); |
window_state->Minimize(); |
ASSERT_TRUE(window_state->IsMinimized()); |
- // The window should remain minimized when exiting maximize mode. |
- DestroyMaximizeModeWindowManager(); |
+ // The window should remain minimized when exiting tablet mode. |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsMinimized()); |
} |
-// Check that full screen mode can be turned on in maximized mode and remains |
+// Check that full screen mode can be turned on in tablet mode and remains |
// upon coming back. |
-TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) { |
+TEST_F(TabletModeWindowManagerTest, AllowFullScreenMode) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1100,7 +1097,7 @@ TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) { |
EXPECT_FALSE(window_state->IsMaximized()); |
EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen mode should still be off and the shelf should maintain its |
// state. |
@@ -1116,17 +1113,17 @@ TEST_F(MaximizeModeWindowManagerTest, AllowFullScreenMode) { |
EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); |
// With the destruction of the manager we should remain in full screen. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsFullscreen()); |
EXPECT_FALSE(window_state->IsMaximized()); |
EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); |
} |
-// Check that the full screen mode will stay active when the maximize mode is |
+// Check that the full screen mode will stay active when the tablet mode is |
// ended. |
-TEST_F(MaximizeModeWindowManagerTest, |
+TEST_F(TabletModeWindowManagerTest, |
FullScreenModeRemainsWhenCreatedInMaximizedMode) { |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
@@ -1136,15 +1133,15 @@ TEST_F(MaximizeModeWindowManagerTest, |
window_state->OnWMEvent(&event_full_screen); |
EXPECT_TRUE(window_state->IsFullscreen()); |
- // After the maximize mode manager is ended, full screen will remain. |
- DestroyMaximizeModeWindowManager(); |
+ // After the tablet mode manager is ended, full screen will remain. |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsFullscreen()); |
} |
// Check that the full screen mode will stay active throughout a maximzied mode |
// session. |
-TEST_F(MaximizeModeWindowManagerTest, |
- FullScreenModeRemainsThroughMaximizeModeSwitch) { |
+TEST_F(TabletModeWindowManagerTest, |
+ FullScreenModeRemainsThroughTabletModeSwitch) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1153,16 +1150,16 @@ TEST_F(MaximizeModeWindowManagerTest, |
window_state->OnWMEvent(&event_full_screen); |
EXPECT_TRUE(window_state->IsFullscreen()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsFullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsFullscreen()); |
} |
// Check that an empty window does not get restored to a tiny size. |
-TEST_F(MaximizeModeWindowManagerTest, |
- CreateAndMaximizeInMaximizeModeShouldRetoreToGoodSizeGoingToDefault) { |
- CreateMaximizeModeWindowManager(); |
+TEST_F(TabletModeWindowManagerTest, |
+ CreateAndMaximizeInTabletModeShouldRetoreToGoodSizeGoingToDefault) { |
+ CreateTabletModeWindowManager(); |
gfx::Rect rect; |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1184,14 +1181,14 @@ TEST_F(MaximizeModeWindowManagerTest, |
EXPECT_EQ(requested_bounds.ToString(), |
window_state->GetRestoreBoundsInScreen().ToString()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_state->IsMaximized()); |
EXPECT_EQ(w1->bounds().ToString(), requested_bounds.ToString()); |
} |
// Check that snapping operations get ignored. |
-TEST_F(MaximizeModeWindowManagerTest, SnapModeTests) { |
+TEST_F(TabletModeWindowManagerTest, SnapModeTests) { |
gfx::Rect rect(20, 140, 100, 100); |
std::unique_ptr<aura::Window> w1( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1201,10 +1198,10 @@ TEST_F(MaximizeModeWindowManagerTest, SnapModeTests) { |
window_state->OnWMEvent(&event_left); |
EXPECT_TRUE(window_state->IsSnapped()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen mode should now be off and it should not come back while in |
- // maximize mode. |
+ // tablet mode. |
EXPECT_FALSE(window_state->IsSnapped()); |
EXPECT_TRUE(window_state->IsMaximized()); |
window_state->OnWMEvent(&event_left); |
@@ -1214,12 +1211,12 @@ TEST_F(MaximizeModeWindowManagerTest, SnapModeTests) { |
EXPECT_FALSE(window_state->IsSnapped()); |
EXPECT_TRUE(window_state->IsMaximized()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_TRUE(window_state->IsSnapped()); |
} |
// Check that non maximizable windows cannot be dragged by the user. |
-TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { |
+TEST_F(TabletModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { |
gfx::Rect rect(10, 10, 100, 100); |
std::unique_ptr<aura::Window> window(CreateFixedSizeNonMaximizableWindow( |
aura::client::WINDOW_TYPE_NORMAL, rect)); |
@@ -1239,8 +1236,7 @@ TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { |
// 2. Check that turning on the manager will stop allowing the window from |
// dragging. |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
- true); |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); |
gfx::Rect center_bounds(window->bounds()); |
EXPECT_NE(rect.origin().ToString(), center_bounds.origin().ToString()); |
generator.MoveMouseTo( |
@@ -1251,8 +1247,7 @@ TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { |
generator.ReleaseLeftButton(); |
EXPECT_EQ(center_bounds.x(), window->bounds().x()); |
EXPECT_EQ(center_bounds.y(), window->bounds().y()); |
- Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
- false); |
+ Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false); |
// 3. Releasing the mazimize manager again will restore the window to its |
// previous bounds and |
@@ -1266,10 +1261,10 @@ TEST_F(MaximizeModeWindowManagerTest, TryToDesktopSizeDragUnmaximizable) { |
EXPECT_EQ(first_dragged_origin.y() + 5, window->bounds().y()); |
} |
-// Test that overview is exited before entering / exiting maximize mode so that |
-// the window changes made by MaximizeModeWindowManager do not conflict with |
+// Test that overview is exited before entering / exiting tablet mode so that |
+// the window changes made by TabletModeWindowManager do not conflict with |
// those made in WindowOverview. |
-TEST_F(MaximizeModeWindowManagerTest, ExitsOverview) { |
+TEST_F(TabletModeWindowManagerTest, ExitsOverview) { |
// Bounds for windows we know can be controlled. |
gfx::Rect rect1(10, 10, 200, 50); |
gfx::Rect rect2(10, 60, 200, 50); |
@@ -1282,7 +1277,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitsOverview) { |
Shell::Get()->window_selector_controller(); |
ASSERT_TRUE(window_selector_controller->ToggleOverview()); |
ASSERT_TRUE(window_selector_controller->IsSelecting()); |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_FALSE(window_selector_controller->IsSelecting()); |
@@ -1290,12 +1285,12 @@ TEST_F(MaximizeModeWindowManagerTest, ExitsOverview) { |
ASSERT_TRUE(window_selector_controller->IsSelecting()); |
// Destroy the manager again and check that the windows return to their |
// previous state. |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(window_selector_controller->IsSelecting()); |
} |
// Test that an edge swipe from the top will end full screen mode. |
-TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { |
+TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { |
// TODO: investigate failure. http://crbug.com/698093. |
if (Shell::GetAshConfig() == Config::MASH) |
return; |
@@ -1310,7 +1305,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { |
wm::WindowState* foreground_window_state = |
wm::GetWindowState(foreground_window.get()); |
wm::ActivateWindow(foreground_window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen both windows. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1335,11 +1330,11 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromTop) { |
EXPECT_FALSE(foreground_window_state->IsFullscreen()); |
EXPECT_TRUE(background_window_state->IsFullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that an edge swipe from the bottom will end full screen mode. |
-TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { |
+TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { |
// TODO: investigate failure. http://crbug.com/698093. |
if (Shell::GetAshConfig() == Config::MASH) |
return; |
@@ -1354,7 +1349,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { |
wm::WindowState* foreground_window_state = |
wm::GetWindowState(foreground_window.get()); |
wm::ActivateWindow(foreground_window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen both windows. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1373,11 +1368,11 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeSwipeFromBottom) { |
EXPECT_FALSE(foreground_window_state->IsFullscreen()); |
EXPECT_TRUE(background_window_state->IsFullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that an edge touch press at the top will end full screen mode. |
-TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { |
+TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { |
// TODO: investigate failure. http://crbug.com/698093. |
if (Shell::GetAshConfig() == Config::MASH) |
return; |
@@ -1392,7 +1387,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { |
wm::WindowState* foreground_window_state = |
wm::GetWindowState(foreground_window.get()); |
wm::ActivateWindow(foreground_window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen both windows. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1413,11 +1408,11 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtTop) { |
EXPECT_FALSE(foreground_window_state->IsFullscreen()); |
EXPECT_TRUE(background_window_state->IsFullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that an edge touch press at the bottom will end full screen mode. |
-TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { |
+TEST_F(TabletModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { |
// TODO: investigate failure. http://crbug.com/698093. |
if (Shell::GetAshConfig() == Config::MASH) |
return; |
@@ -1432,7 +1427,7 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { |
wm::WindowState* foreground_window_state = |
wm::GetWindowState(foreground_window.get()); |
wm::ActivateWindow(foreground_window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen both windows. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1455,17 +1450,17 @@ TEST_F(MaximizeModeWindowManagerTest, ExitFullScreenWithEdgeTouchAtBottom) { |
EXPECT_FALSE(foreground_window_state->IsFullscreen()); |
EXPECT_TRUE(background_window_state->IsFullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that an edge swipe from the top on an immersive mode window will not end |
// full screen mode. |
-TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { |
+TEST_F(TabletModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { |
std::unique_ptr<aura::Window> window(CreateWindow( |
aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(10, 10, 200, 50))); |
wm::WindowState* window_state = wm::GetWindowState(window.get()); |
wm::ActivateWindow(window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen the window. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1485,17 +1480,17 @@ TEST_F(MaximizeModeWindowManagerTest, NoExitImmersiveModeWithEdgeSwipeFromTop) { |
EXPECT_TRUE(window_state->IsFullscreen()); |
EXPECT_TRUE(window_state->in_immersive_fullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Test that an edge swipe from the bottom will not end immersive mode. |
-TEST_F(MaximizeModeWindowManagerTest, |
+TEST_F(TabletModeWindowManagerTest, |
NoExitImmersiveModeWithEdgeSwipeFromBottom) { |
std::unique_ptr<aura::Window> window(CreateWindow( |
aura::client::WINDOW_TYPE_NORMAL, gfx::Rect(10, 10, 200, 50))); |
wm::WindowState* window_state = wm::GetWindowState(window.get()); |
wm::ActivateWindow(window.get()); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
// Fullscreen the window. |
wm::WMEvent event(wm::WM_EVENT_TOGGLE_FULLSCREEN); |
@@ -1516,13 +1511,13 @@ TEST_F(MaximizeModeWindowManagerTest, |
EXPECT_TRUE(window_state->IsFullscreen()); |
EXPECT_TRUE(window_state->in_immersive_fullscreen()); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
// Tests that windows with the always-on-top property are not managed by |
-// the MaximizeModeWindowManager while maximize mode is engaged (i.e., |
+// the TabletModeWindowManager while tablet mode is engaged (i.e., |
// they remain free-floating). |
-TEST_F(MaximizeModeWindowManagerTest, AlwaysOnTopWindows) { |
+TEST_F(TabletModeWindowManagerTest, AlwaysOnTopWindows) { |
gfx::Rect rect1(10, 10, 200, 50); |
gfx::Rect rect2(20, 140, 100, 100); |
@@ -1540,10 +1535,10 @@ TEST_F(MaximizeModeWindowManagerTest, AlwaysOnTopWindows) { |
EXPECT_TRUE(wm::GetWindowState(w1.get())->can_be_dragged()); |
EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); |
- // Enter maximize mode. Neither window should be managed because they have |
+ // Enter tablet mode. Neither window should be managed because they have |
// the always-on-top property set, which means that none of their properties |
// should change. |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
ASSERT_TRUE(manager); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); |
@@ -1581,8 +1576,8 @@ TEST_F(MaximizeModeWindowManagerTest, AlwaysOnTopWindows) { |
EXPECT_TRUE(wm::GetWindowState(w1.get())->can_be_dragged()); |
EXPECT_TRUE(wm::GetWindowState(w2.get())->can_be_dragged()); |
- // The always-on-top windows should not change when leaving maximize mode. |
- DestroyMaximizeModeWindowManager(); |
+ // The always-on-top windows should not change when leaving tablet mode. |
+ DestroyTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(w1.get())->IsMaximized()); |
EXPECT_FALSE(wm::GetWindowState(w2.get())->IsMaximized()); |
EXPECT_EQ(rect1.ToString(), w1->bounds().ToString()); |
@@ -1593,14 +1588,14 @@ TEST_F(MaximizeModeWindowManagerTest, AlwaysOnTopWindows) { |
// Tests that windows that can control maximized bounds are not maximized |
// and not tracked. |
-TEST_F(MaximizeModeWindowManagerTest, DontMaximizeClientManagedWindows) { |
+TEST_F(TabletModeWindowManagerTest, DontMaximizeClientManagedWindows) { |
gfx::Rect rect(10, 10, 200, 50); |
std::unique_ptr<aura::Window> window( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
wm::GetWindowState(window.get())->set_allow_set_bounds_direct(true); |
- MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
+ TabletModeWindowManager* manager = CreateTabletModeWindowManager(); |
EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
} |
@@ -1653,13 +1648,13 @@ class TestObserver : public wm::WindowStateObserver { |
} // namespace |
-TEST_F(MaximizeModeWindowManagerTest, StateTyepChange) { |
+TEST_F(TabletModeWindowManagerTest, StateTyepChange) { |
TestObserver observer; |
gfx::Rect rect(10, 10, 200, 50); |
std::unique_ptr<aura::Window> window( |
CreateWindow(aura::client::WINDOW_TYPE_NORMAL, rect)); |
- CreateMaximizeModeWindowManager(); |
+ CreateTabletModeWindowManager(); |
wm::WindowState* window_state = wm::GetWindowState(window.get()); |
window_state->AddObserver(&observer); |
@@ -1669,7 +1664,7 @@ TEST_F(MaximizeModeWindowManagerTest, StateTyepChange) { |
EXPECT_EQ(0, observer.GetPreCountAndReset()); |
EXPECT_EQ(0, observer.GetPostCountAndReset()); |
- // Window is already in maximized mode. |
+ // Window is already in tablet mode. |
wm::WMEvent maximize_event(wm::WM_EVENT_MAXIMIZE); |
window_state->OnWMEvent(&maximize_event); |
EXPECT_EQ(0, observer.GetPreCountAndReset()); |
@@ -1704,7 +1699,7 @@ TEST_F(MaximizeModeWindowManagerTest, StateTyepChange) { |
window_state->RemoveObserver(&observer); |
- DestroyMaximizeModeWindowManager(); |
+ DestroyTabletModeWindowManager(); |
} |
} // namespace ash |