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

Unified Diff: chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm

Issue 885493005: Setting Guest last-active for the User Manager doesn't create the Guest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oh noes, the braces Created 5 years, 11 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
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/user_manager_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm
diff --git a/chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm b/chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm
index 4444f1f2f412ae82b68d3b2661684f84bc10031e..760adcb940d9e5b8996852669e315c09653bce0f 100644
--- a/chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm
+++ b/chrome/browser/ui/cocoa/profiles/user_manager_mac_unittest.mm
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
+#include "base/prefs/pref_service.h"
#include "base/run_loop.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/ui/user_manager.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
@@ -39,6 +41,13 @@ class UserManagerMacTest : public BrowserWithTestWindowTest {
};
TEST_F(UserManagerMacTest, ShowUserManager) {
+ // Set the ProfileLastUsed pref so that SetActiveProfileToGuestIfLocked()
+ // uses a last active profile that's in the ProfileInfoCache, not default.
+ g_browser_process->local_state()->SetString(
+ prefs::kProfileLastUsed,
+ g_browser_process->profile_manager()->GetProfileInfoCache().
+ GetPathOfProfileAtIndex(0).BaseName().MaybeAsASCII());
+
EXPECT_FALSE(UserManager::IsShowing());
UserManager::Show(base::FilePath(),
profiles::USER_MANAGER_NO_TUTORIAL,
« no previous file with comments | « chrome/browser/ui/cocoa/profiles/user_manager_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698