summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/base/testing_profile.cc9
-rw-r--r--chrome/test/base/testing_profile.h21
-rw-r--r--chrome/test/base/testing_profile_manager.cc5
-rw-r--r--chrome/test/base/testing_profile_manager.h7
4 files changed, 25 insertions, 17 deletions
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index ac2177f..7b31c30 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -309,7 +309,7 @@ TestingProfile::TestingProfile(
#if defined(ENABLE_EXTENSIONS)
scoped_refptr<ExtensionSpecialStoragePolicy> extension_policy,
#endif
- scoped_ptr<PrefServiceSyncable> prefs,
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs,
TestingProfile* parent,
bool guest_session,
const std::string& supervised_user_id,
@@ -633,7 +633,8 @@ scoped_refptr<base::SequencedTaskRunner> TestingProfile::GetIOTaskRunner() {
return base::MessageLoop::current()->task_runner();
}
-TestingPrefServiceSyncable* TestingProfile::GetTestingPrefService() {
+syncable_prefs::TestingPrefServiceSyncable*
+TestingProfile::GetTestingPrefService() {
DCHECK(prefs_);
DCHECK(testing_prefs_);
return testing_prefs_;
@@ -734,7 +735,7 @@ net::CookieMonster* TestingProfile::GetCookieMonster() {
void TestingProfile::CreateTestingPrefService() {
DCHECK(!prefs_.get());
- testing_prefs_ = new TestingPrefServiceSyncable();
+ testing_prefs_ = new syncable_prefs::TestingPrefServiceSyncable();
prefs_.reset(testing_prefs_);
user_prefs::UserPrefs::Set(this, prefs_.get());
chrome::RegisterUserProfilePrefs(testing_prefs_->registry());
@@ -989,7 +990,7 @@ void TestingProfile::Builder::SetExtensionSpecialStoragePolicy(
#endif
void TestingProfile::Builder::SetPrefService(
- scoped_ptr<PrefServiceSyncable> prefs) {
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs) {
pref_service_ = prefs.Pass();
}
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h
index c941cd8..6663fa5 100644
--- a/chrome/test/base/testing_profile.h
+++ b/chrome/test/base/testing_profile.h
@@ -16,6 +16,10 @@
#include "components/domain_reliability/clear_mode.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
+class BrowserContextDependencyManager;
+class ExtensionSpecialStoragePolicy;
+class HostContentSettingsMap;
+
namespace content {
class MockResourceContext;
class SSLHostStateDelegate;
@@ -37,11 +41,10 @@ namespace storage {
class SpecialStoragePolicy;
}
-class BrowserContextDependencyManager;
-class ExtensionSpecialStoragePolicy;
-class HostContentSettingsMap;
+namespace syncable_prefs {
class PrefServiceSyncable;
class TestingPrefServiceSyncable;
+}
class TestingProfile : public Profile {
public:
@@ -94,7 +97,7 @@ class TestingProfile : public Profile {
void SetPath(const base::FilePath& path);
// Sets the PrefService to be used by this profile.
- void SetPrefService(scoped_ptr<PrefServiceSyncable> prefs);
+ void SetPrefService(scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs);
// Makes the Profile being built a guest profile.
void SetGuestSession();
@@ -119,7 +122,7 @@ class TestingProfile : public Profile {
bool build_called_;
// Various staging variables where values are held until Build() is invoked.
- scoped_ptr<PrefServiceSyncable> pref_service_;
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> pref_service_;
#if defined(ENABLE_EXTENSIONS)
scoped_refptr<ExtensionSpecialStoragePolicy> extension_policy_;
#endif
@@ -153,7 +156,7 @@ class TestingProfile : public Profile {
#if defined(ENABLE_EXTENSIONS)
scoped_refptr<ExtensionSpecialStoragePolicy> extension_policy,
#endif
- scoped_ptr<PrefServiceSyncable> prefs,
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs,
TestingProfile* parent,
bool guest_session,
const std::string& supervised_user_id,
@@ -196,7 +199,7 @@ class TestingProfile : public Profile {
// Allow setting a profile as Guest after-the-fact to simplify some tests.
void SetGuestSession(bool guest);
- TestingPrefServiceSyncable* GetTestingPrefService();
+ syncable_prefs::TestingPrefServiceSyncable* GetTestingPrefService();
// Called on the parent of an incognito |profile|. Usually called from the
// constructor of an incognito TestingProfile, but can also be used by tests
@@ -321,9 +324,9 @@ class TestingProfile : public Profile {
protected:
base::Time start_time_;
- scoped_ptr<PrefServiceSyncable> prefs_;
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs_;
// ref only for right type, lifecycle is managed by prefs_
- TestingPrefServiceSyncable* testing_prefs_;
+ syncable_prefs::TestingPrefServiceSyncable* testing_prefs_;
private:
// Creates a temporary directory for use by this profile.
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc
index 6964623..c55037b 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -55,7 +55,7 @@ bool TestingProfileManager::SetUp() {
TestingProfile* TestingProfileManager::CreateTestingProfile(
const std::string& profile_name,
- scoped_ptr<PrefServiceSyncable> prefs,
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs,
const base::string16& user_name,
int avatar_id,
const std::string& supervised_user_id,
@@ -109,7 +109,8 @@ TestingProfile* TestingProfileManager::CreateTestingProfile(
TestingProfile* TestingProfileManager::CreateTestingProfile(
const std::string& name) {
DCHECK(called_set_up_);
- return CreateTestingProfile(name, scoped_ptr<PrefServiceSyncable>(),
+ return CreateTestingProfile(name,
+ scoped_ptr<syncable_prefs::PrefServiceSyncable>(),
base::UTF8ToUTF16(name), 0, std::string(),
TestingProfile::TestingFactories());
}
diff --git a/chrome/test/base/testing_profile_manager.h b/chrome/test/base/testing_profile_manager.h
index e051379..421075d 100644
--- a/chrome/test/base/testing_profile_manager.h
+++ b/chrome/test/base/testing_profile_manager.h
@@ -16,12 +16,15 @@
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_profile.h"
-class PrefServiceSyncable;
class ProfileInfoCache;
class ProfileManager;
class TestingBrowserProcess;
class TestingProfile;
+namespace syncable_prefs {
+class PrefServiceSyncable;
+}
+
// The TestingProfileManager is a TestingProfile factory for a multi-profile
// environment. It will bring up a full ProfileManager and attach it to the
// TestingBrowserProcess set up in your test.
@@ -51,7 +54,7 @@ class TestingProfileManager {
// |factories| contains BCKSs to use with the newly created profile.
TestingProfile* CreateTestingProfile(
const std::string& profile_name,
- scoped_ptr<PrefServiceSyncable> prefs,
+ scoped_ptr<syncable_prefs::PrefServiceSyncable> prefs,
const base::string16& user_name,
int avatar_id,
const std::string& supervised_user_id,