| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 63 // Creates a new guest TestingProfile whose data lives in the guest profile |
| 64 // test environment directory, as specified by the profile manager. | 64 // test environment directory, as specified by the profile manager. |
| 65 // This profile will not be added to the ProfileInfoCache. This will | 65 // This profile will not be added to the ProfileInfoCache. This will |
| 66 // register the TestingProfile with the profile subsystem as well. | 66 // register the TestingProfile with the profile subsystem as well. |
| 67 // The subsystem owns the Profile and returns a weak pointer. | 67 // The subsystem owns the Profile and returns a weak pointer. |
| 68 TestingProfile* CreateGuestProfile(); | 68 TestingProfile* CreateGuestProfile(); |
| 69 | 69 |
| 70 // Creates a TestingProfile whose data lives in the User Manager profile |
| 71 // test environment directory, as specified by the profile manager. |
| 72 // This profile will not be added to the ProfileInfoCache. This will |
| 73 // register the TestingProfile with the profile subsystem as well. |
| 74 // The subsystem owns the Profile and returns a weak pointer. |
| 75 TestingProfile* CreateUserManagerProfile(); |
| 76 |
| 70 // Deletes a TestingProfile from the profile subsystem. | 77 // Deletes a TestingProfile from the profile subsystem. |
| 71 void DeleteTestingProfile(const std::string& profile_name); | 78 void DeleteTestingProfile(const std::string& profile_name); |
| 72 | 79 |
| 73 // Deletes a guest TestingProfile from the profile manager. | 80 // Deletes a TestingProfile with |path| from the profile subsystem. |
| 74 void DeleteGuestProfile(); | 81 void DeleteProfileWithPath(const base::FilePath& path); |
| 75 | 82 |
| 76 // Deletes the cache instance. This is useful for testing that the cache is | 83 // Deletes the cache instance. This is useful for testing that the cache is |
| 77 // properly persisting data. | 84 // properly persisting data. |
| 78 void DeleteProfileInfoCache(); | 85 void DeleteProfileInfoCache(); |
| 79 | 86 |
| 80 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. | 87 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. |
| 81 void SetLoggedIn(bool logged_in); | 88 void SetLoggedIn(bool logged_in); |
| 82 | 89 |
| 83 // Helper accessors. | 90 // Helper accessors. |
| 84 const base::FilePath& profiles_dir(); | 91 const base::FilePath& profiles_dir(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 108 // Weak reference to the profile manager. | 115 // Weak reference to the profile manager. |
| 109 ProfileManager* profile_manager_; | 116 ProfileManager* profile_manager_; |
| 110 | 117 |
| 111 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 118 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
| 112 TestingProfilesMap testing_profiles_; | 119 TestingProfilesMap testing_profiles_; |
| 113 | 120 |
| 114 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 121 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
| 115 }; | 122 }; |
| 116 | 123 |
| 117 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 124 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| OLD | NEW |