| OLD | NEW |
| 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 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| 6 #define CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 6 #define CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const std::string& profile_name, | 53 const std::string& profile_name, |
| 54 scoped_ptr<PrefServiceSyncable> prefs, | 54 scoped_ptr<PrefServiceSyncable> prefs, |
| 55 const string16& user_name, | 55 const string16& user_name, |
| 56 int avatar_id, | 56 int avatar_id, |
| 57 const std::string& managed_user_id, | 57 const std::string& managed_user_id, |
| 58 const TestingProfile::TestingFactories& factories); | 58 const TestingProfile::TestingFactories& factories); |
| 59 | 59 |
| 60 // Small helper for creating testing profiles. Just forwards to above. | 60 // Small helper for creating testing profiles. Just forwards to above. |
| 61 TestingProfile* CreateTestingProfile(const std::string& name); | 61 TestingProfile* CreateTestingProfile(const std::string& name); |
| 62 | 62 |
| 63 // Creates a new guest TestingProfile whose data lives in the guest profile |
| 64 // test environment directory, as specified by the profile manager. |
| 65 // This profile will not be added to the ProfileInfoCache. This will |
| 66 // register the TestingProfile with the profile subsystem as well. |
| 67 // The subsystem owns the Profile and returns a weak pointer. |
| 68 TestingProfile* CreateGuestProfile(); |
| 69 |
| 63 // Deletes a TestingProfile from the profile subsystem. | 70 // Deletes a TestingProfile from the profile subsystem. |
| 64 void DeleteTestingProfile(const std::string& profile_name); | 71 void DeleteTestingProfile(const std::string& profile_name); |
| 65 | 72 |
| 73 // Deletes a guest TestingProfile from the profile manager. |
| 74 void DeleteGuestProfile(); |
| 75 |
| 66 // Deletes the cache instance. This is useful for testing that the cache is | 76 // Deletes the cache instance. This is useful for testing that the cache is |
| 67 // properly persisting data. | 77 // properly persisting data. |
| 68 void DeleteProfileInfoCache(); | 78 void DeleteProfileInfoCache(); |
| 69 | 79 |
| 70 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. | 80 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. |
| 71 void SetLoggedIn(bool logged_in); | 81 void SetLoggedIn(bool logged_in); |
| 72 | 82 |
| 73 // Helper accessors. | 83 // Helper accessors. |
| 74 const base::FilePath& profiles_dir(); | 84 const base::FilePath& profiles_dir(); |
| 75 ProfileManager* profile_manager(); | 85 ProfileManager* profile_manager(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 98 // Weak reference to the profile manager. | 108 // Weak reference to the profile manager. |
| 99 ProfileManager* profile_manager_; | 109 ProfileManager* profile_manager_; |
| 100 | 110 |
| 101 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 111 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
| 102 TestingProfilesMap testing_profiles_; | 112 TestingProfilesMap testing_profiles_; |
| 103 | 113 |
| 104 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 114 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
| 105 }; | 115 }; |
| 106 | 116 |
| 107 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 117 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| OLD | NEW |