Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: chrome/browser/autocomplete/history_url_provider_unittest.cc

Issue 19616004: Add asserts to TestingProfile::CreateHistoryService to ensure files are deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix release unit tests Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_url_provider_unittest.cc
diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc
index b26c9a0abeb068e27039220771c561ce3538318e..01387518a5ef564a2f02fe8d892212ba17f6934d 100644
--- a/chrome/browser/autocomplete/history_url_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc
@@ -152,12 +152,12 @@ class HistoryURLProviderTest : public testing::Test,
// testing::Test
virtual void SetUp() {
- SetUpImpl(false);
+ ASSERT_TRUE(SetUpImpl(false));
}
virtual void TearDown();
// Does the real setup.
- void SetUpImpl(bool no_db);
+ bool SetUpImpl(bool no_db) WARN_UNUSED_RESULT;
// Fills test data into the history system.
void FillData();
@@ -195,7 +195,7 @@ class HistoryURLProviderTest : public testing::Test,
class HistoryURLProviderTestNoDB : public HistoryURLProviderTest {
protected:
virtual void SetUp() {
- SetUpImpl(true);
+ ASSERT_TRUE(SetUpImpl(true));
}
};
@@ -204,9 +204,10 @@ void HistoryURLProviderTest::OnProviderUpdate(bool updated_matches) {
base::MessageLoop::current()->Quit();
}
-void HistoryURLProviderTest::SetUpImpl(bool no_db) {
+bool HistoryURLProviderTest::SetUpImpl(bool no_db) {
profile_.reset(new TestingProfile());
- profile_->CreateHistoryService(true, no_db);
+ if (!(profile_->CreateHistoryService(true, no_db)))
+ return false;
if (!no_db) {
profile_->BlockUntilHistoryProcessesPendingRequests();
profile_->BlockUntilHistoryIndexIsRefreshed();
@@ -219,6 +220,7 @@ void HistoryURLProviderTest::SetUpImpl(bool no_db) {
TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile_.get(), &HistoryURLProviderTest::CreateTemplateURLService);
FillData();
+ return true;
}
void HistoryURLProviderTest::TearDown() {

Powered by Google App Engine
This is Rietveld 408576698