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

Side by Side Diff: chrome/browser/autocomplete/search_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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/autocomplete/search_provider.h" 5 #include "chrome/browser/autocomplete/search_provider.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void SearchProviderTest::TearDownTestCase() { 176 void SearchProviderTest::TearDownTestCase() {
177 // Make sure the global instance of FieldTrialList is gone. 177 // Make sure the global instance of FieldTrialList is gone.
178 delete field_trial_list_; 178 delete field_trial_list_;
179 } 179 }
180 180
181 void SearchProviderTest::SetUp() { 181 void SearchProviderTest::SetUp() {
182 // Make sure that fetchers are automatically ungregistered upon destruction. 182 // Make sure that fetchers are automatically ungregistered upon destruction.
183 test_factory_.set_remove_fetcher_on_delete(true); 183 test_factory_.set_remove_fetcher_on_delete(true);
184 184
185 // We need both the history service and template url model loaded. 185 // We need both the history service and template url model loaded.
186 profile_.CreateHistoryService(true, false); 186 ASSERT_TRUE(profile_.CreateHistoryService(true, false));
187 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( 187 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
188 &profile_, &TemplateURLServiceFactory::BuildInstanceFor); 188 &profile_, &TemplateURLServiceFactory::BuildInstanceFor);
189 189
190 TemplateURLService* turl_model = 190 TemplateURLService* turl_model =
191 TemplateURLServiceFactory::GetForProfile(&profile_); 191 TemplateURLServiceFactory::GetForProfile(&profile_);
192 192
193 turl_model->Load(); 193 turl_model->Load();
194 194
195 // Reset the default TemplateURL. 195 // Reset the default TemplateURL.
196 TemplateURLData data; 196 TemplateURLData data;
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 } else { 2157 } else {
2158 ASSERT_NE(sug_end, sug_it) << "Failed to find " << suggestion; 2158 ASSERT_NE(sug_end, sug_it) << "Failed to find " << suggestion;
2159 EXPECT_EQ(ASCIIToUTF16(suggestion), sug_it->suggestion()); 2159 EXPECT_EQ(ASCIIToUTF16(suggestion), sug_it->suggestion());
2160 ++sug_it; 2160 ++sug_it;
2161 } 2161 }
2162 } 2162 }
2163 EXPECT_EQ(sug_end, sug_it); 2163 EXPECT_EQ(sug_end, sug_it);
2164 EXPECT_EQ(nav_end, nav_it); 2164 EXPECT_EQ(nav_end, nav_it);
2165 } 2165 }
2166 } 2166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698