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 | |
59 // Helper accessors. | 55 // Helper accessors. |
60 ProfileManager* profile_manager(); | 56 ProfileManager* profile_manager(); |
61 ProfileInfoCache* profile_info_cache(); | 57 ProfileInfoCache* profile_info_cache(); |
62 | 58 |
63 private: | 59 private: |
64 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; | 60 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; |
65 | 61 |
66 // Does the actual ASSERT-checked SetUp work. This function cannot have a | 62 // Does the actual ASSERT-checked SetUp work. This function cannot have a |
67 // return value, so it sets the |called_set_up_| flag on success and that is | 63 // return value, so it sets the |called_set_up_| flag on success and that is |
68 // returned in the public SetUp. | 64 // returned in the public SetUp. |
(...skipping 14 matching lines...) Expand all Loading... |
83 // Weak reference to the profile manager. | 79 // Weak reference to the profile manager. |
84 ProfileManager* profile_manager_; | 80 ProfileManager* profile_manager_; |
85 | 81 |
86 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 82 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
87 TestingProfilesMap testing_profiles_; | 83 TestingProfilesMap testing_profiles_; |
88 | 84 |
89 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 85 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
90 }; | 86 }; |
91 | 87 |
92 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 88 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
OLD | NEW |