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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc

Issue 253063002: CleanUp: Introduce UserInfo. Move session_state stuff to ash/session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 8 months 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
Index: chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
index 44fe75c00afe5ca491001b4446ef4697bf95b3e4..8dc3171619456f522e935f68c8994acac7b35448 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ash/session/user_info.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/ash_test_base.h"
@@ -102,7 +103,8 @@ class MultiUserWindowManagerChromeOSTest : public AshTestBase {
// manager. This function gets the current user from it and also sets it to
// the multi user window manager.
std::string GetAndValidateCurrentUserFromSessionStateObserver() {
- const std::string& user = session_state_delegate()->get_activated_user();
+ const std::string& user =
+ session_state_delegate()->GetActiveUserInfo()->GetUserID();
if (user != multi_user_window_manager_->GetCurrentUserForTest())
multi_user_window_manager()->ActiveUserChanged(user);
return user;
@@ -148,6 +150,9 @@ void MultiUserWindowManagerChromeOSTest::SetUp() {
session_state_delegate_ =
static_cast<TestSessionStateDelegate*> (
ash::Shell::GetInstance()->session_state_delegate());
+ session_state_delegate_->AddUser("a");
+ session_state_delegate_->AddUser("b");
+ session_state_delegate_->AddUser("c");
}
void MultiUserWindowManagerChromeOSTest::SetUpForThisManyWindows(int windows) {
@@ -643,11 +648,11 @@ TEST_F(MultiUserWindowManagerChromeOSTest, SwitchUsersUponModalityChange) {
// Making the window system modal should not change anything.
MakeWindowSystemModal(window(0));
- EXPECT_EQ("a", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID());
// Making the window owned by user B should switch users.
multi_user_window_manager()->SetWindowOwner(window(0), "b");
- EXPECT_EQ("b", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("b", session_state_delegate()->GetActiveUserInfo()->GetUserID());
}
// Test that a system modal dialog will not switch desktop if active user has
@@ -658,11 +663,11 @@ TEST_F(MultiUserWindowManagerChromeOSTest, DontSwitchUsersUponModalityChange) {
// Making the window system modal should not change anything.
MakeWindowSystemModal(window(0));
- EXPECT_EQ("a", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID());
// Making the window owned by user a should not switch users.
multi_user_window_manager()->SetWindowOwner(window(0), "a");
- EXPECT_EQ("a", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID());
}
// Test that a system modal dialog will not switch if shown on correct desktop
@@ -678,7 +683,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest,
MakeWindowSystemModal(window(0));
// Showing the window should trigger no user switch.
window(0)->Show();
- EXPECT_EQ("a", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("a", session_state_delegate()->GetActiveUserInfo()->GetUserID());
}
// Test that a system modal dialog will switch if shown on incorrect desktop but
@@ -694,7 +699,7 @@ TEST_F(MultiUserWindowManagerChromeOSTest,
MakeWindowSystemModal(window(0));
// Showing the window should trigger a user switch.
window(0)->Show();
- EXPECT_EQ("b", session_state_delegate()->get_activated_user());
+ EXPECT_EQ("b", session_state_delegate()->GetActiveUserInfo()->GetUserID());
}
// Test that using the full user switch animations are working as expected.

Powered by Google App Engine
This is Rietveld 408576698