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

Side by Side 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, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h" 5 #include "chrome/browser/ui/cocoa/profiles/user_manager_mac.h"
6 6
7 #include "base/prefs/pref_service.h"
7 #include "base/run_loop.h" 8 #include "base/run_loop.h"
8 #include "chrome/browser/profiles/profile_window.h" 9 #include "chrome/browser/profiles/profile_window.h"
9 #include "chrome/browser/ui/user_manager.h" 10 #include "chrome/browser/ui/user_manager.h"
11 #include "chrome/common/pref_names.h"
10 #include "chrome/test/base/browser_with_test_window_test.h" 12 #include "chrome/test/base/browser_with_test_window_test.h"
11 #include "chrome/test/base/testing_browser_process.h" 13 #include "chrome/test/base/testing_browser_process.h"
12 #include "chrome/test/base/testing_profile_manager.h" 14 #include "chrome/test/base/testing_profile_manager.h"
13 15
14 class UserManagerMacTest : public BrowserWithTestWindowTest { 16 class UserManagerMacTest : public BrowserWithTestWindowTest {
15 public: 17 public:
16 UserManagerMacTest() 18 UserManagerMacTest()
17 : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) { 19 : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) {
18 } 20 }
19 21
(...skipping 12 matching lines...) Expand all
32 BrowserWithTestWindowTest::TearDown(); 34 BrowserWithTestWindowTest::TearDown();
33 } 35 }
34 36
35 private: 37 private:
36 TestingProfileManager testing_profile_manager_; 38 TestingProfileManager testing_profile_manager_;
37 39
38 DISALLOW_COPY_AND_ASSIGN(UserManagerMacTest); 40 DISALLOW_COPY_AND_ASSIGN(UserManagerMacTest);
39 }; 41 };
40 42
41 TEST_F(UserManagerMacTest, ShowUserManager) { 43 TEST_F(UserManagerMacTest, ShowUserManager) {
44 // Set the ProfileLastUsed pref so that SetActiveProfileToGuestIfLocked()
45 // uses a last active profile that's in the ProfileInfoCache, not default.
46 g_browser_process->local_state()->SetString(
47 prefs::kProfileLastUsed,
48 g_browser_process->profile_manager()->GetProfileInfoCache().
49 GetPathOfProfileAtIndex(0).BaseName().MaybeAsASCII());
50
42 EXPECT_FALSE(UserManager::IsShowing()); 51 EXPECT_FALSE(UserManager::IsShowing());
43 UserManager::Show(base::FilePath(), 52 UserManager::Show(base::FilePath(),
44 profiles::USER_MANAGER_NO_TUTORIAL, 53 profiles::USER_MANAGER_NO_TUTORIAL,
45 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); 54 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
46 EXPECT_TRUE(UserManager::IsShowing()); 55 EXPECT_TRUE(UserManager::IsShowing());
47 56
48 UserManager::Hide(); 57 UserManager::Hide();
49 EXPECT_FALSE(UserManager::IsShowing()); 58 EXPECT_FALSE(UserManager::IsShowing());
50 } 59 }
OLDNEW
« 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