OLD | NEW |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 void SearchProviderTest::TearDownTestCase() { | 184 void SearchProviderTest::TearDownTestCase() { |
185 // Make sure the global instance of FieldTrialList is gone. | 185 // Make sure the global instance of FieldTrialList is gone. |
186 delete field_trial_list_; | 186 delete field_trial_list_; |
187 } | 187 } |
188 | 188 |
189 void SearchProviderTest::SetUp() { | 189 void SearchProviderTest::SetUp() { |
190 // Make sure that fetchers are automatically ungregistered upon destruction. | 190 // Make sure that fetchers are automatically ungregistered upon destruction. |
191 test_factory_.set_remove_fetcher_on_delete(true); | 191 test_factory_.set_remove_fetcher_on_delete(true); |
192 | 192 |
193 // We need both the history service and template url model loaded. | 193 // We need both the history service and template url model loaded. |
194 ASSERT_TRUE(profile_.CreateHistoryService(true, false)); | 194 profile_.CreateHistoryService(true, false); |
195 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 195 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
196 &profile_, &TemplateURLServiceFactory::BuildInstanceFor); | 196 &profile_, &TemplateURLServiceFactory::BuildInstanceFor); |
197 | 197 |
198 TemplateURLService* turl_model = | 198 TemplateURLService* turl_model = |
199 TemplateURLServiceFactory::GetForProfile(&profile_); | 199 TemplateURLServiceFactory::GetForProfile(&profile_); |
200 | 200 |
201 turl_model->Load(); | 201 turl_model->Load(); |
202 | 202 |
203 // Reset the default TemplateURL. | 203 // Reset the default TemplateURL. |
204 TemplateURLData data; | 204 TemplateURLData data; |
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2172 } else { | 2172 } else { |
2173 ASSERT_NE(sug_end, sug_it) << "Failed to find " << suggestion; | 2173 ASSERT_NE(sug_end, sug_it) << "Failed to find " << suggestion; |
2174 EXPECT_EQ(ASCIIToUTF16(suggestion), sug_it->suggestion()); | 2174 EXPECT_EQ(ASCIIToUTF16(suggestion), sug_it->suggestion()); |
2175 ++sug_it; | 2175 ++sug_it; |
2176 } | 2176 } |
2177 } | 2177 } |
2178 EXPECT_EQ(sug_end, sug_it); | 2178 EXPECT_EQ(sug_end, sug_it); |
2179 EXPECT_EQ(nav_end, nav_it); | 2179 EXPECT_EQ(nav_end, nav_it); |
2180 } | 2180 } |
2181 } | 2181 } |
OLD | NEW |