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

Unified Diff: chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc

Issue 2111443002: mash: Migrate SessionStateDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 6 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/chromeos/login/ui/user_adding_screen_browsertest.cc
diff --git a/chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc b/chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc
index 01f83fa9cfd9f6667c27f7d806d4f6bf43e81a2e..2dbed90870fc1d932b431608811872e1fc753f8f 100644
--- a/chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc
+++ b/chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "ash/common/session/session_state_delegate.h"
-#include "ash/shell.h"
+#include "ash/common/wm_shell.h"
#include "base/macros.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
@@ -22,6 +22,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/window.h"
using namespace testing;
@@ -110,31 +111,26 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, PRE_CancelAdding) {
IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, CancelAdding) {
EXPECT_EQ(3u, user_manager::UserManager::Get()->GetUsers().size());
EXPECT_EQ(0u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
-
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ ash::WmShell::Get()->GetSessionStateDelegate()->GetSessionState());
LoginUser(kTestUsers[0]);
EXPECT_EQ(1u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ ash::WmShell::Get()->GetSessionStateDelegate()->GetSessionState());
UserAddingScreen::Get()->Start();
content::RunAllPendingInMessageLoop();
EXPECT_EQ(1, user_adding_started());
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ ash::WmShell::Get()->GetSessionStateDelegate()->GetSessionState());
UserAddingScreen::Get()->Cancel();
WaitUntilUserAddingFinishedOrCancelled();
content::RunAllPendingInMessageLoop();
EXPECT_EQ(1, user_adding_finished());
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ ash::WmShell::Get()->GetSessionStateDelegate()->GetSessionState());
EXPECT_TRUE(LoginDisplayHost::default_host() == nullptr);
EXPECT_EQ(1u, user_manager::UserManager::Get()->GetLoggedInUsers().size());
@@ -150,13 +146,12 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, PRE_AddingSeveralUsers) {
}
IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, AddingSeveralUsers) {
+ ash::WmShell* wm_shell = ash::WmShell::Get();
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ wm_shell->GetSessionStateDelegate()->GetSessionState());
LoginUser(kTestUsers[0]);
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ wm_shell->GetSessionStateDelegate()->GetSessionState());
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
@@ -165,22 +160,19 @@ IN_PROC_BROWSER_TEST_F(UserAddingScreenTest, AddingSeveralUsers) {
content::RunAllPendingInMessageLoop();
EXPECT_EQ(i, user_adding_started());
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ wm_shell->GetSessionStateDelegate()->GetSessionState());
AddUser(kTestUsers[i]);
WaitUntilUserAddingFinishedOrCancelled();
content::RunAllPendingInMessageLoop();
EXPECT_EQ(i, user_adding_finished());
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ wm_shell->GetSessionStateDelegate()->GetSessionState());
EXPECT_TRUE(LoginDisplayHost::default_host() == nullptr);
ASSERT_EQ(unsigned(i + 1), user_manager->GetLoggedInUsers().size());
}
EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
- ash::Shell::GetInstance()->session_state_delegate()->
- GetSessionState());
+ wm_shell->GetSessionStateDelegate()->GetSessionState());
// Now check how unlock policy works for these users.
PrefService* prefs1 =

Powered by Google App Engine
This is Rietveld 408576698