Commit 2e92edfe authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

cros: Enable multiprofile for everyone.

BUG=338941
R=dpolukhin@chromium.org, nkostylev@chromium.org

Review URL: https://codereview.chromium.org/146193005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251352 0039d316-1c4b-4281-b951-d872f2087c98
parent 488b56cf
...@@ -832,7 +832,6 @@ class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { ...@@ -832,7 +832,6 @@ class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
FileManagerBrowserTestBase::SetUpCommandLine(command_line); FileManagerBrowserTestBase::SetUpCommandLine(command_line);
command_line->AppendSwitch(switches::kMultiProfiles); command_line->AppendSwitch(switches::kMultiProfiles);
command_line->AppendSwitch(chromeos::switches::kForceMultiProfileInTests);
// Logs in to a dummy profile (For making MultiProfileWindowManager happy; // Logs in to a dummy profile (For making MultiProfileWindowManager happy;
// browser test creates a default window and the manager tries to assign a // browser test creates a default window and the manager tries to assign a
// user for it, and we need a profile connected to a user.) // user for it, and we need a profile connected to a user.)
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "chrome/browser/chromeos/login/multi_profile_user_controller.h" #include "chrome/browser/chromeos/login/multi_profile_user_controller.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_change_registrar.h"
#include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_registry_simple.h"
...@@ -19,7 +18,6 @@ ...@@ -19,7 +18,6 @@
#include "chrome/browser/prefs/pref_service_syncable.h" #include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "google_apis/gaia/gaia_auth_util.h" #include "google_apis/gaia/gaia_auth_util.h"
namespace chromeos { namespace chromeos {
...@@ -61,18 +59,9 @@ void MultiProfileUserController::RegisterPrefs( ...@@ -61,18 +59,9 @@ void MultiProfileUserController::RegisterPrefs(
// static // static
void MultiProfileUserController::RegisterProfilePrefs( void MultiProfileUserController::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) { user_prefs::PrefRegistrySyncable* registry) {
// Use "disabled" default if there is no user manager or no logged in user.
// This is true for signin profile (where the value does not matter) or
// for the primary user's profile. This essentially disables multiprofile
// unless the primary user has a policy to say otherwise.
const bool use_disable_default =
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kForceMultiProfileInTests) &&
(!UserManager::IsInitialized() ||
UserManager::Get()->GetLoggedInUsers().size() == 1);
registry->RegisterStringPref( registry->RegisterStringPref(
prefs::kMultiProfileUserBehavior, prefs::kMultiProfileUserBehavior,
use_disable_default ? kBehaviorNotAllowed : kBehaviorUnrestricted, kBehaviorUnrestricted,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
} }
......
...@@ -84,12 +84,7 @@ void SAMLOfflineSigninLimiterTest::CreateLimiter() { ...@@ -84,12 +84,7 @@ void SAMLOfflineSigninLimiterTest::CreateLimiter() {
} }
void SAMLOfflineSigninLimiterTest::SetUp() { void SAMLOfflineSigninLimiterTest::SetUp() {
const UserList user_list;
EXPECT_CALL(*user_manager_, GetLoggedInUsers())
.Times(1)
.WillOnce(ReturnRef(user_list));
profile_.reset(new TestingProfile); profile_.reset(new TestingProfile);
Mock::VerifyAndClearExpectations(user_manager_);
SAMLOfflineSigninLimiterFactory::SetClockForTesting(&clock_); SAMLOfflineSigninLimiterFactory::SetClockForTesting(&clock_);
user_manager_->AddUser(kTestUser); user_manager_->AddUser(kTestUser);
......
...@@ -132,7 +132,6 @@ class ScreenLockerTest : public InProcessBrowserTest { ...@@ -132,7 +132,6 @@ class ScreenLockerTest : public InProcessBrowserTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
} }
scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_;
......
...@@ -39,7 +39,6 @@ class UserAddingScreenTest : public LoginManagerTest, ...@@ -39,7 +39,6 @@ class UserAddingScreenTest : public LoginManagerTest,
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
LoginManagerTest::SetUpCommandLine(command_line); LoginManagerTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(::switches::kMultiProfiles); command_line->AppendSwitch(::switches::kMultiProfiles);
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
} }
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
......
...@@ -59,7 +59,6 @@ class AccountsOptionsTest : public LoginManagerTest { ...@@ -59,7 +59,6 @@ class AccountsOptionsTest : public LoginManagerTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
LoginManagerTest::SetUpCommandLine(command_line); LoginManagerTest::SetUpCommandLine(command_line);
command_line->AppendSwitch(::switches::kMultiProfiles); command_line->AppendSwitch(::switches::kMultiProfiles);
command_line->AppendSwitch(switches::kForceMultiProfileInTests);
} }
protected: protected:
......
...@@ -149,11 +149,6 @@ const char kFirstExecAfterBoot[] = "first-exec-after-boot"; ...@@ -149,11 +149,6 @@ const char kFirstExecAfterBoot[] = "first-exec-after-boot";
// tests can change how it's brought up. This flag disables that. // tests can change how it's brought up. This flag disables that.
const char kForceLoginManagerInTests[] = "force-login-manager-in-tests"; const char kForceLoginManagerInTests[] = "force-login-manager-in-tests";
// Sets primary user's default multiprofile behavior to 'unrestricted' for
// tests so that multiprofile is enabled for any user.
// TODO(xiyuan): Remove when multiprofile is released to everyone.
const char kForceMultiProfileInTests[] = "force-multi-profiles-in-tests";
// Makes GPU sandbox failures nonfatal. // Makes GPU sandbox failures nonfatal.
const char kGpuSandboxFailuresNonfatal[] = "gpu-sandbox-failures-nonfatal"; const char kGpuSandboxFailuresNonfatal[] = "gpu-sandbox-failures-nonfatal";
......
...@@ -58,7 +58,6 @@ CHROMEOS_EXPORT extern const char kFileManagerEnableNewAudioPlayer[]; ...@@ -58,7 +58,6 @@ CHROMEOS_EXPORT extern const char kFileManagerEnableNewAudioPlayer[];
CHROMEOS_EXPORT extern const char kFileManagerEnableMultiProfile[]; CHROMEOS_EXPORT extern const char kFileManagerEnableMultiProfile[];
CHROMEOS_EXPORT extern const char kFirstExecAfterBoot[]; CHROMEOS_EXPORT extern const char kFirstExecAfterBoot[];
CHROMEOS_EXPORT extern const char kForceLoginManagerInTests[]; CHROMEOS_EXPORT extern const char kForceLoginManagerInTests[];
CHROMEOS_EXPORT extern const char kForceMultiProfileInTests[];
CHROMEOS_EXPORT extern const char kGpuSandboxFailuresNonfatal[]; CHROMEOS_EXPORT extern const char kGpuSandboxFailuresNonfatal[];
CHROMEOS_EXPORT extern const char kGuestSession[]; CHROMEOS_EXPORT extern const char kGuestSession[];
CHROMEOS_EXPORT extern const char kHasChromeOSDiamondKey[]; CHROMEOS_EXPORT extern const char kHasChromeOSDiamondKey[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment