| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
| 6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
| 7 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Creates a new profile by adding |count| to the end of the path. Use this | 26 // Creates a new profile by adding |count| to the end of the path. Use this |
| 27 // when you need to have more than one TestingProfile running at the same | 27 // when you need to have more than one TestingProfile running at the same |
| 28 // time. | 28 // time. |
| 29 explicit TestingProfile(int count); | 29 explicit TestingProfile(int count); |
| 30 | 30 |
| 31 virtual ~TestingProfile(); | 31 virtual ~TestingProfile(); |
| 32 | 32 |
| 33 // Creates the history service. If |delete_file| is true, the history file is | 33 // Creates the history service. If |delete_file| is true, the history file is |
| 34 // deleted first, then the HistoryService is created. As TestingProfile | 34 // deleted first, then the HistoryService is created. As TestingProfile |
| 35 // deletes the directory containing the files used by HistoryService, the | 35 // deletes the directory containing the files used by HistoryService, this |
| 36 // boolean only matters if you're recreating the HistoryService. | 36 // only matters if you're recreating the HistoryService. If |no_db| is true, |
| 37 void CreateHistoryService(bool delete_file); | 37 // the history backend will fail to initialize its database; this is useful |
| 38 // for testing error conditions. |
| 39 void CreateHistoryService(bool delete_file, bool no_db); |
| 38 | 40 |
| 39 // Creates the BookmkarBarModel. If not invoked the bookmark bar model is | 41 // Creates the BookmkarBarModel. If not invoked the bookmark bar model is |
| 40 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then | 42 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then |
| 41 // the model is created. As TestingProfile deletes the directory containing | 43 // the model is created. As TestingProfile deletes the directory containing |
| 42 // the files used by HistoryService, the boolean only matters if you're | 44 // the files used by HistoryService, the boolean only matters if you're |
| 43 // recreating the BookmarkModel. | 45 // recreating the BookmarkModel. |
| 44 // | 46 // |
| 45 // NOTE: this does not block until the bookmarks are loaded. For that use | 47 // NOTE: this does not block until the bookmarks are loaded. For that use |
| 46 // BlockUntilBookmarkModelLoaded. | 48 // BlockUntilBookmarkModelLoaded. |
| 47 void CreateBookmarkModel(bool delete_file); | 49 void CreateBookmarkModel(bool delete_file); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 248 |
| 247 virtual ProfileId GetRuntimeId() { | 249 virtual ProfileId GetRuntimeId() { |
| 248 return original_profile_->GetRuntimeId(); | 250 return original_profile_->GetRuntimeId(); |
| 249 } | 251 } |
| 250 | 252 |
| 251 protected: | 253 protected: |
| 252 Profile* original_profile_; | 254 Profile* original_profile_; |
| 253 }; | 255 }; |
| 254 | 256 |
| 255 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 257 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |