Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Unified Diff: chrome/browser/ui/ash/multi_user_window_manager_unittest.cc

Issue 55303003: Fixing drag and drop visibility issues of tabs on a visiting desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/multi_user_window_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/multi_user_window_manager_unittest.cc
diff --git a/chrome/browser/ui/ash/multi_user_window_manager_unittest.cc b/chrome/browser/ui/ash/multi_user_window_manager_unittest.cc
index 6fa31e8f3b6bbd7622a8835886203e4866b5b711..ae38f907ddd0853d3bd15b76e61dd8acbdd43730 100644
--- a/chrome/browser/ui/ash/multi_user_window_manager_unittest.cc
+++ b/chrome/browser/ui/ash/multi_user_window_manager_unittest.cc
@@ -473,5 +473,40 @@ TEST_F(MultiUserWindowManagerTest, TransientWindows) {
window(7)->RemoveTransientChild(window(9));
}
+// Test that the initial visibility state gets remembered.
+TEST_F(MultiUserWindowManagerTest, PreserveInitialVisibility) {
+ SetUpForThisManyWindows(4);
+
+ // Set our initial show state before we assign an owner.
+ window(0)->Show();
+ window(1)->Hide();
+ window(2)->Show();
+ window(3)->Hide();
+ EXPECT_EQ("S[], H[], S[], H[]", GetStatus());
+
+ // First test: The show state gets preserved upon user switch.
+ multi_user_window_manager()->SetWindowOwner(window(0), "A");
+ multi_user_window_manager()->SetWindowOwner(window(1), "A");
+ multi_user_window_manager()->SetWindowOwner(window(2), "B");
+ multi_user_window_manager()->SetWindowOwner(window(3), "B");
+ EXPECT_EQ("S[A], H[A], H[B], H[B]", GetStatus());
+ multi_user_window_manager()->ActiveUserChanged("B");
+ EXPECT_EQ("H[A], H[A], S[B], H[B]", GetStatus());
+ multi_user_window_manager()->ActiveUserChanged("A");
+ EXPECT_EQ("S[A], H[A], H[B], H[B]", GetStatus());
+
+ // Second test: Transferring the window to another desktop preserves the
+ // show state.
+ multi_user_window_manager()->ShowWindowForUser(window(0), "B");
+ multi_user_window_manager()->ShowWindowForUser(window(1), "B");
+ multi_user_window_manager()->ShowWindowForUser(window(2), "A");
+ multi_user_window_manager()->ShowWindowForUser(window(3), "A");
+ EXPECT_EQ("H[A,B], H[A,B], S[B,A], H[B,A]", GetStatus());
+ multi_user_window_manager()->ActiveUserChanged("B");
+ EXPECT_EQ("S[A,B], H[A,B], H[B,A], H[B,A]", GetStatus());
+ multi_user_window_manager()->ActiveUserChanged("A");
+ EXPECT_EQ("H[A,B], H[A,B], S[B,A], H[B,A]", GetStatus());
+}
+
} // namespace test
} // namespace ash
« no previous file with comments | « chrome/browser/ui/ash/multi_user_window_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698