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

Side by Side Diff: chrome/browser/chromeos/login/login_utils_browsertest.cc

Issue 271533004: Turning on MultiProfile by default for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 16 matching lines...) Expand all
27 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" 27 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
28 #include "chrome/browser/chromeos/profiles/profile_helper.h" 28 #include "chrome/browser/chromeos/profiles/profile_helper.h"
29 #include "chrome/browser/chromeos/settings/cros_settings.h" 29 #include "chrome/browser/chromeos/settings/cros_settings.h"
30 #include "chrome/browser/chromeos/settings/device_settings_service.h" 30 #include "chrome/browser/chromeos/settings/device_settings_service.h"
31 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" 31 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
32 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h" 32 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h"
33 #include "chrome/browser/io_thread.h" 33 #include "chrome/browser/io_thread.h"
34 #include "chrome/browser/net/predictor.h" 34 #include "chrome/browser/net/predictor.h"
35 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" 35 #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
36 #include "chrome/browser/profiles/profile_manager.h" 36 #include "chrome/browser/profiles/profile_manager.h"
37 #include "chrome/browser/profiles/profiles_state.h"
37 #include "chrome/browser/rlz/rlz.h" 38 #include "chrome/browser/rlz/rlz.h"
38 #include "chrome/common/chrome_content_client.h" 39 #include "chrome/common/chrome_content_client.h"
39 #include "chrome/common/chrome_paths.h" 40 #include "chrome/common/chrome_paths.h"
40 #include "chrome/common/chrome_switches.h"
41 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
42 #include "chrome/test/base/chrome_unit_test_suite.h" 42 #include "chrome/test/base/chrome_unit_test_suite.h"
43 #include "chrome/test/base/scoped_testing_local_state.h" 43 #include "chrome/test/base/scoped_testing_local_state.h"
44 #include "chrome/test/base/testing_browser_process.h" 44 #include "chrome/test/base/testing_browser_process.h"
45 #include "chromeos/chromeos_switches.h" 45 #include "chromeos/chromeos_switches.h"
46 #include "chromeos/cryptohome/mock_async_method_caller.h" 46 #include "chromeos/cryptohome/mock_async_method_caller.h"
47 #include "chromeos/cryptohome/system_salt_getter.h" 47 #include "chromeos/cryptohome/system_salt_getter.h"
48 #include "chromeos/dbus/fake_dbus_thread_manager.h" 48 #include "chromeos/dbus/fake_dbus_thread_manager.h"
49 #include "chromeos/disks/disk_mount_manager.h" 49 #include "chromeos/disks/disk_mount_manager.h"
50 #include "chromeos/disks/mock_disk_mount_manager.h" 50 #include "chromeos/disks/mock_disk_mount_manager.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // will be executed. 200 // will be executed.
201 io_thread_.reset( 201 io_thread_.reset(
202 new content::TestBrowserThread(BrowserThread::IO, fake_io_loop)); 202 new content::TestBrowserThread(BrowserThread::IO, fake_io_loop));
203 203
204 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); 204 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir());
205 205
206 CommandLine* command_line = CommandLine::ForCurrentProcess(); 206 CommandLine* command_line = CommandLine::ForCurrentProcess();
207 command_line->AppendSwitchASCII( 207 command_line->AppendSwitchASCII(
208 policy::switches::kDeviceManagementUrl, kDMServer); 208 policy::switches::kDeviceManagementUrl, kDMServer);
209 209
210 if (!command_line->HasSwitch(::switches::kMultiProfiles))
211 command_line->AppendSwitchASCII(switches::kLoginProfile, "user");
212
213 // DBusThreadManager should be initialized before io_thread_state_, as 210 // DBusThreadManager should be initialized before io_thread_state_, as
214 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl, 211 // DBusThreadManager is used from chromeos::ProxyConfigServiceImpl,
215 // which is part of io_thread_state_. 212 // which is part of io_thread_state_.
216 DBusThreadManager::InitializeWithStub(); 213 DBusThreadManager::InitializeWithStub();
217 214
218 SystemSaltGetter::Initialize(); 215 SystemSaltGetter::Initialize();
219 LoginState::Initialize(); 216 LoginState::Initialize();
220 217
221 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, _)) 218 EXPECT_CALL(mock_statistics_provider_, GetMachineStatistic(_, _))
222 .WillRepeatedly(Return(false)); 219 .WillRepeatedly(Return(false));
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 DISALLOW_COPY_AND_ASSIGN(LoginUtilsTest); 523 DISALLOW_COPY_AND_ASSIGN(LoginUtilsTest);
527 }; 524 };
528 525
529 class LoginUtilsParamTest 526 class LoginUtilsParamTest
530 : public LoginUtilsTest, 527 : public LoginUtilsTest,
531 public testing::WithParamInterface<bool> { 528 public testing::WithParamInterface<bool> {
532 public: 529 public:
533 LoginUtilsParamTest() {} 530 LoginUtilsParamTest() {}
534 531
535 virtual void SetUp() OVERRIDE { 532 virtual void SetUp() OVERRIDE {
536 CommandLine* command_line = CommandLine::ForCurrentProcess(); 533 // TODO(skuhne): Remove this test class entirely (and the headers)
537 if (GetParam()) 534 // CommandLine* command_line = CommandLine::ForCurrentProcess();
538 command_line->AppendSwitch(::switches::kMultiProfiles); 535 // if (GetParam())
536 // command_line->AppendSwitch(::switches::kMultiProfiles);
Mr4D (OOO till 08-26) 2014/05/14 16:32:40 Sorry didn't get around to do this before passing
zel 2014/05/14 17:48:39 Done.
539 LoginUtilsTest::SetUp(); 537 LoginUtilsTest::SetUp();
540 } 538 }
541 539
542 private: 540 private:
543 DISALLOW_COPY_AND_ASSIGN(LoginUtilsParamTest); 541 DISALLOW_COPY_AND_ASSIGN(LoginUtilsParamTest);
544 }; 542 };
545 543
546 class LoginUtilsBlockingLoginTest 544 class LoginUtilsBlockingLoginTest
547 : public LoginUtilsTest, 545 : public LoginUtilsTest,
548 public testing::WithParamInterface<int> {}; 546 public testing::WithParamInterface<int> {};
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 LoginUtilsBlockingLoginTest, 721 LoginUtilsBlockingLoginTest,
724 testing::Values(0, 1, 2, 3, 4, 5)); 722 testing::Values(0, 1, 2, 3, 4, 5));
725 723
726 INSTANTIATE_TEST_CASE_P(LoginUtilsParamTestInstantiation, 724 INSTANTIATE_TEST_CASE_P(LoginUtilsParamTestInstantiation,
727 LoginUtilsParamTest, 725 LoginUtilsParamTest,
728 testing::Bool()); 726 testing::Bool());
729 727
730 } // namespace 728 } // namespace
731 729
732 } // namespace chromeos 730 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698