OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 TestingProfile* CreateTestingProfile(const std::string& profile_name, | 45 TestingProfile* CreateTestingProfile(const std::string& profile_name, |
46 const string16& user_name, | 46 const string16& user_name, |
47 int avatar_id); | 47 int avatar_id); |
48 | 48 |
49 // Small helper for creating testing profiles. Just forwards to above. | 49 // Small helper for creating testing profiles. Just forwards to above. |
50 TestingProfile* CreateTestingProfile(const std::string& name); | 50 TestingProfile* CreateTestingProfile(const std::string& name); |
51 | 51 |
52 // Deletes a TestingProfile from the profile subsystem. | 52 // Deletes a TestingProfile from the profile subsystem. |
53 void DeleteTestingProfile(const std::string& profile_name); | 53 void DeleteTestingProfile(const std::string& profile_name); |
54 | 54 |
| 55 // Deletes the cache instance. This is useful for testing that the cache is |
| 56 // properly persisting data. |
| 57 void DeleteProfileInfoCache(); |
| 58 |
55 // Helper accessors. | 59 // Helper accessors. |
56 ProfileManager* profile_manager(); | 60 ProfileManager* profile_manager(); |
57 ProfileInfoCache* profile_info_cache(); | 61 ProfileInfoCache* profile_info_cache(); |
58 | 62 |
59 private: | 63 private: |
60 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; | 64 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; |
61 | 65 |
62 // Does the actual ASSERT-checked SetUp work. This function cannot have a | 66 // Does the actual ASSERT-checked SetUp work. This function cannot have a |
63 // return value, so it sets the |called_set_up_| flag on success and that is | 67 // return value, so it sets the |called_set_up_| flag on success and that is |
64 // returned in the public SetUp. | 68 // returned in the public SetUp. |
(...skipping 14 matching lines...) Expand all Loading... |
79 // Weak reference to the profile manager. | 83 // Weak reference to the profile manager. |
80 ProfileManager* profile_manager_; | 84 ProfileManager* profile_manager_; |
81 | 85 |
82 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 86 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
83 TestingProfilesMap testing_profiles_; | 87 TestingProfilesMap testing_profiles_; |
84 | 88 |
85 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 89 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
86 }; | 90 }; |
87 | 91 |
88 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 92 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
OLD | NEW |