Index: chrome/browser/chromeos/login/session/user_session_manager.cc |
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc |
index 07bfdbd19efa59d77e00b2f4e27486649a138248..f829bdb08658bc6ff031c2def7987cf85cd59b1f 100644 |
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc |
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc |
@@ -55,6 +55,7 @@ |
#include "chromeos/ime/input_method_manager.h" |
#include "chromeos/network/portal_detector/network_portal_detector.h" |
#include "chromeos/network/portal_detector/network_portal_detector_strategy.h" |
+#include "components/session_manager/core/session_manager.h" |
#include "components/signin/core/browser/signin_manager_base.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_service.h" |
@@ -466,11 +467,15 @@ void UserSessionManager::OnNewRefreshTokenAvaiable(Profile* user_profile) { |
void UserSessionManager::OnConnectionTypeChanged( |
net::NetworkChangeNotifier::ConnectionType type) { |
+ bool is_running_test = |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ ::switches::kTestName) || |
+ base::CommandLine::ForCurrentProcess()->HasSwitch(::switches::kTestType); |
UserManager* user_manager = UserManager::Get(); |
if (type == net::NetworkChangeNotifier::CONNECTION_NONE || |
!user_manager->IsUserLoggedIn() || |
!user_manager->IsLoggedInAsRegularUser() || |
- user_manager->IsLoggedInAsStub()) { |
+ user_manager->IsLoggedInAsStub() || is_running_test) { |
return; |
} |
@@ -682,6 +687,9 @@ void UserSessionManager::FinalizePrepareProfile(Profile* profile) { |
profile->OnLogin(); |
+ g_browser_process->platform_part()->SessionManager()->SetSessionState( |
+ session_manager::SESSION_STATE_LOGGED_IN_NOT_ACTIVE); |
+ |
// Send the notification before creating the browser so additional objects |
// that need the profile (e.g. the launcher) can be created first. |
content::NotificationService::current()->Notify( |