Chromium Code Reviews| Index: chrome/test/base/testing_profile.cc |
| diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
| index e35899875925ed2d5b97e524fe9524cd83d342be..88f0316b27daa4f57dd51a1cf02d73a73c2e8a9b 100644 |
| --- a/chrome/test/base/testing_profile.cc |
| +++ b/chrome/test/base/testing_profile.cc |
| @@ -354,12 +354,15 @@ static BrowserContextKeyedService* BuildHistoryService( |
| return new HistoryService(static_cast<Profile*>(profile)); |
| } |
| -void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { |
| +bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { |
| DestroyHistoryService(); |
| if (delete_file) { |
| base::FilePath path = GetPath(); |
| path = path.Append(chrome::kHistoryFilename); |
| - base::DeleteFile(path, false); |
| + if (!base::DeleteFile(path, false) || |
|
sky
2013/07/23 13:59:37
nit: seems like you could fit this on one line and
rmcilroy
2013/07/23 14:30:50
Done.
|
| + base::PathExists(path)) { |
| + return false; |
| + } |
| } |
| // This will create and init the history service. |
| HistoryService* history_service = static_cast<HistoryService*>( |
| @@ -372,6 +375,7 @@ void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { |
| } |
| // Disable WebHistoryService by default, since it makes network requests. |
| WebHistoryServiceFactory::GetInstance()->SetTestingFactory(this, NULL); |
| + return true; |
| } |
| void TestingProfile::DestroyHistoryService() { |