Commit ab01537c authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

cros: Fix and enable failing MultiUserWindowManagerChromeOS.TabletModeInteraction.

Now that tablet mode manager tracks all user windows and not just current
accounts, the window should be non account windows should be maximized
on entering tablet mode, not on user switch.

Test: unit_tests MultiUserWindowManagerChromeOS.TabletModeInteraction
Bug: 903427
Change-Id: Ib21a7e1d7f1a37f8a571ad16226f11e03f0db960
Reviewed-on: https://chromium-review.googlesource.com/c/1329502Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606998}
parent 0c58c53b
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "ash/test_shell_delegate.h" #include "ash/test_shell_delegate.h"
#include "ash/wm/mru_window_tracker.h" #include "ash/wm/mru_window_tracker.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "ash/wm/tablet_mode/tablet_mode_controller_test_api.h"
#include "ash/wm/tablet_mode/tablet_mode_window_manager.h" #include "ash/wm/tablet_mode/tablet_mode_window_manager.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
#include "ash/wm/wm_event.h" #include "ash/wm/wm_event.h"
...@@ -816,11 +815,9 @@ TEST_F(MultiUserWindowManagerChromeOSTest, PreserveInitialVisibility) { ...@@ -816,11 +815,9 @@ TEST_F(MultiUserWindowManagerChromeOSTest, PreserveInitialVisibility) {
EXPECT_EQ("H[A,B], H[A,B], S[B,A], H[B,A]", GetStatus()); EXPECT_EQ("H[A,B], H[A,B], S[B,A], H[B,A]", GetStatus());
} }
// Test that in case of an activated tablet mode, windows from other users get // Test that in case of an activated tablet mode, windows from all users get
// maximized after a user switch. // maximized on entering tablet mode.
// TODO(sammiequon): disabled as expectations aren't correct with TEST_F(MultiUserWindowManagerChromeOSTest, TabletModeInteraction) {
// addition of call to OnTabletModeToggled(). https://crbug.com/903427
TEST_F(MultiUserWindowManagerChromeOSTest, DISABLED_TabletModeInteraction) {
SetUpForThisManyWindows(2); SetUpForThisManyWindows(2);
const AccountId account_id_A(AccountId::FromUserEmail("A")); const AccountId account_id_A(AccountId::FromUserEmail("A"));
...@@ -835,14 +832,15 @@ TEST_F(MultiUserWindowManagerChromeOSTest, DISABLED_TabletModeInteraction) { ...@@ -835,14 +832,15 @@ TEST_F(MultiUserWindowManagerChromeOSTest, DISABLED_TabletModeInteraction) {
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true);
multi_user_window_manager()->OnTabletModeToggled(true); multi_user_window_manager()->OnTabletModeToggled(true);
EXPECT_TRUE(wm::GetWindowState(window(0))->IsMaximized());
EXPECT_FALSE(wm::GetWindowState(window(1))->IsMaximized());
// After we start switching to B, the windows of user B should maximize.
StartUserTransitionAnimation(account_id_B);
EXPECT_TRUE(wm::GetWindowState(window(0))->IsMaximized()); EXPECT_TRUE(wm::GetWindowState(window(0))->IsMaximized());
EXPECT_TRUE(wm::GetWindowState(window(1))->IsMaximized()); EXPECT_TRUE(wm::GetWindowState(window(1))->IsMaximized());
// Tests that on exiting tablet mode, the window states return to not
// maximized.
Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
multi_user_window_manager()->OnTabletModeToggled(false);
EXPECT_FALSE(wm::GetWindowState(window(0))->IsMaximized());
EXPECT_FALSE(wm::GetWindowState(window(1))->IsMaximized());
} }
// Test that a system modal dialog will switch to the desktop of the owning // Test that a system modal dialog will switch to the desktop of the owning
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment