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

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: Propigate CreateHistoryService return value properly 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 c35b45fa90965b4354711113e6149e70f0950266..05238fa417877e9072bc2ee92a25be23e28cf4bc 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();
@@ -197,7 +197,7 @@ class HistoryURLProviderTest : public testing::Test,
class HistoryURLProviderTestNoDB : public HistoryURLProviderTest {
protected:
virtual void SetUp() {
- SetUpImpl(true);
+ ASSERT_TRUE(SetUpImpl(true));
}
};
@@ -206,9 +206,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();
@@ -221,6 +222,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