Chromium Code Reviews| Index: chrome/browser/autocomplete/search_provider_unittest.cc |
| diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc |
| index 0045d6dd5074a95c34637f5b8b796d826b25be4e..d45a8d769637d6f7fc8a0d609a2bffd2afdeabc0 100644 |
| --- a/chrome/browser/autocomplete/search_provider_unittest.cc |
| +++ b/chrome/browser/autocomplete/search_provider_unittest.cc |
| @@ -15,6 +15,7 @@ |
| #include "chrome/browser/search_engines/template_url.h" |
| #include "chrome/browser/search_engines/template_url_service.h" |
| #include "chrome/browser/search_engines/template_url_service_factory.h" |
| +#include "chrome/browser/webdata/web_data_service_factory.h" |
| #include "chrome/common/pref_names.h" |
| #include "chrome/test/base/testing_browser_process.h" |
| #include "chrome/test/base/testing_profile.h" |
| @@ -25,6 +26,16 @@ |
| using content::BrowserThread; |
| +namespace { |
| + |
| +// Build no WebDataService. |
| +static scoped_refptr<RefcountedProfileKeyedService> BuildNull( |
|
Ilya Sherman
2012/03/27 01:01:17
nit: No need to declare this method static, since
GeorgeY
2012/03/30 19:20:12
Removed it.
|
| + Profile* profile) { |
| + return NULL; |
| +} |
| + |
| +} // namespace |
| + |
| // The following environment is configured for these tests: |
| // . The TemplateURL default_t_url_ is set as the default provider. |
| // . The TemplateURL keyword_t_url_ is added to the TemplateURLService. This |
| @@ -112,6 +123,8 @@ void SearchProviderTest::SetUp() { |
| SearchProvider::set_query_suggest_immediately(true); |
| // We need both the history service and template url model loaded. |
| + // TemplateURLService relies on the absence of the WebDataService in tests. |
| + WebDataServiceFactory::GetInstance()->SetTestingFactory(&profile_, BuildNull); |
| profile_.CreateHistoryService(true, false); |
| profile_.CreateTemplateURLService(); |