| 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 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/files/file_path.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "chrome/test/base/scoped_testing_local_state.h" | 16 #include "chrome/test/base/scoped_testing_local_state.h" |
| 16 | 17 |
| 17 class PrefServiceSyncable; | 18 class PrefServiceSyncable; |
| 18 class ProfileInfoCache; | 19 class ProfileInfoCache; |
| 19 class ProfileManager; | 20 class ProfileManager; |
| 20 class TestingBrowserProcess; | 21 class TestingBrowserProcess; |
| 21 class TestingProfile; | 22 class TestingProfile; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void DeleteTestingProfile(const std::string& profile_name); | 59 void DeleteTestingProfile(const std::string& profile_name); |
| 59 | 60 |
| 60 // Deletes the cache instance. This is useful for testing that the cache is | 61 // Deletes the cache instance. This is useful for testing that the cache is |
| 61 // properly persisting data. | 62 // properly persisting data. |
| 62 void DeleteProfileInfoCache(); | 63 void DeleteProfileInfoCache(); |
| 63 | 64 |
| 64 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. | 65 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. |
| 65 void SetLoggedIn(bool logged_in); | 66 void SetLoggedIn(bool logged_in); |
| 66 | 67 |
| 67 // Helper accessors. | 68 // Helper accessors. |
| 69 const base::FilePath& profiles_dir(); |
| 68 ProfileManager* profile_manager(); | 70 ProfileManager* profile_manager(); |
| 69 ProfileInfoCache* profile_info_cache(); | 71 ProfileInfoCache* profile_info_cache(); |
| 70 | 72 |
| 71 private: | 73 private: |
| 72 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; | 74 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; |
| 73 | 75 |
| 74 // Does the actual ASSERT-checked SetUp work. This function cannot have a | 76 // Does the actual ASSERT-checked SetUp work. This function cannot have a |
| 75 // return value, so it sets the |called_set_up_| flag on success and that is | 77 // return value, so it sets the |called_set_up_| flag on success and that is |
| 76 // returned in the public SetUp. | 78 // returned in the public SetUp. |
| 77 void SetUpInternal(); | 79 void SetUpInternal(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 91 // Weak reference to the profile manager. | 93 // Weak reference to the profile manager. |
| 92 ProfileManager* profile_manager_; | 94 ProfileManager* profile_manager_; |
| 93 | 95 |
| 94 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 96 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
| 95 TestingProfilesMap testing_profiles_; | 97 TestingProfilesMap testing_profiles_; |
| 96 | 98 |
| 97 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 99 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 102 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| OLD | NEW |