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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows sync integration test failure Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/data/policy/policy_test_cases.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/base/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 base::Unretained(this))); 199 base::Unretained(this)));
200 } else { 200 } else {
201 FinishInit(); 201 FinishInit();
202 } 202 }
203 } 203 }
204 204
205 TestingProfile::TestingProfile( 205 TestingProfile::TestingProfile(
206 const FilePath& path, 206 const FilePath& path,
207 Delegate* delegate, 207 Delegate* delegate,
208 scoped_refptr<ExtensionSpecialStoragePolicy> extension_policy, 208 scoped_refptr<ExtensionSpecialStoragePolicy> extension_policy,
209 scoped_ptr<PrefServiceSyncable> prefs) 209 scoped_ptr<PrefServiceSyncable> prefs,
210 bool off_the_record)
210 : start_time_(Time::Now()), 211 : start_time_(Time::Now()),
211 prefs_(prefs.release()), 212 prefs_(prefs.release()),
212 testing_prefs_(NULL), 213 testing_prefs_(NULL),
213 incognito_(false), 214 incognito_(off_the_record),
214 last_session_exited_cleanly_(true), 215 last_session_exited_cleanly_(true),
215 extension_special_storage_policy_(extension_policy), 216 extension_special_storage_policy_(extension_policy),
216 profile_path_(path), 217 profile_path_(path),
217 profile_dependency_manager_(ProfileDependencyManager::GetInstance()), 218 profile_dependency_manager_(ProfileDependencyManager::GetInstance()),
218 delegate_(delegate) { 219 delegate_(delegate) {
219 220
220 // If no profile path was supplied, create one. 221 // If no profile path was supplied, create one.
221 if (profile_path_.empty()) { 222 if (profile_path_.empty()) {
222 CreateTempProfileDir(); 223 CreateTempProfileDir();
223 profile_path_ = temp_dir_.path(); 224 profile_path_ = temp_dir_.path();
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) { 755 bool TestingProfile::WasCreatedByVersionOrLater(const std::string& version) {
755 return true; 756 return true;
756 } 757 }
757 758
758 Profile::ExitType TestingProfile::GetLastSessionExitType() { 759 Profile::ExitType TestingProfile::GetLastSessionExitType() {
759 return last_session_exited_cleanly_ ? EXIT_NORMAL : EXIT_CRASHED; 760 return last_session_exited_cleanly_ ? EXIT_NORMAL : EXIT_CRASHED;
760 } 761 }
761 762
762 TestingProfile::Builder::Builder() 763 TestingProfile::Builder::Builder()
763 : build_called_(false), 764 : build_called_(false),
764 delegate_(NULL) { 765 delegate_(NULL),
766 off_the_record_(false) {
765 } 767 }
766 768
767 TestingProfile::Builder::~Builder() { 769 TestingProfile::Builder::~Builder() {
768 } 770 }
769 771
770 void TestingProfile::Builder::SetPath(const FilePath& path) { 772 void TestingProfile::Builder::SetPath(const FilePath& path) {
771 path_ = path; 773 path_ = path;
772 } 774 }
773 775
774 void TestingProfile::Builder::SetDelegate(Delegate* delegate) { 776 void TestingProfile::Builder::SetDelegate(Delegate* delegate) {
775 delegate_ = delegate; 777 delegate_ = delegate;
776 } 778 }
777 779
778 void TestingProfile::Builder::SetExtensionSpecialStoragePolicy( 780 void TestingProfile::Builder::SetExtensionSpecialStoragePolicy(
779 scoped_refptr<ExtensionSpecialStoragePolicy> policy) { 781 scoped_refptr<ExtensionSpecialStoragePolicy> policy) {
780 extension_policy_ = policy; 782 extension_policy_ = policy;
781 } 783 }
782 784
783 void TestingProfile::Builder::SetPrefService( 785 void TestingProfile::Builder::SetPrefService(
784 scoped_ptr<PrefServiceSyncable> prefs) { 786 scoped_ptr<PrefServiceSyncable> prefs) {
785 pref_service_ = prefs.Pass(); 787 pref_service_ = prefs.Pass();
786 } 788 }
787 789
790 void TestingProfile::Builder::SetOffTheRecord() {
791 off_the_record_ = true;
792 }
793
788 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 794 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
789 DCHECK(!build_called_); 795 DCHECK(!build_called_);
790 build_called_ = true; 796 build_called_ = true;
791 return scoped_ptr<TestingProfile>(new TestingProfile( 797 return scoped_ptr<TestingProfile>(new TestingProfile(
792 path_, 798 path_,
793 delegate_, 799 delegate_,
794 extension_policy_, 800 extension_policy_,
795 pref_service_.Pass())); 801 pref_service_.Pass(),
802 off_the_record_));
796 } 803 }
OLDNEW
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/data/policy/policy_test_cases.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698