| Index: chrome/browser/search/instant_unittest_base.cc
|
| diff --git a/chrome/browser/search/instant_unittest_base.cc b/chrome/browser/search/instant_unittest_base.cc
|
| index 80b43f6b0fa268fc3a31496c4d19f626af8b8e93..b45dd19a63dcf8251dd85fc2f01534bb617d9c08 100644
|
| --- a/chrome/browser/search/instant_unittest_base.cc
|
| +++ b/chrome/browser/search/instant_unittest_base.cc
|
| @@ -34,24 +34,8 @@ InstantUnitTestBase::~InstantUnitTestBase() {
|
| }
|
|
|
| void InstantUnitTestBase::SetUp() {
|
| - SetUpHelper();
|
| -}
|
| -
|
| -void InstantUnitTestBase::SetUpHelper() {
|
| chrome::EnableQueryExtractionForTesting();
|
| - BrowserWithTestWindowTest::SetUp();
|
| -
|
| - TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
|
| - profile(), &TemplateURLServiceFactory::BuildInstanceFor);
|
| - template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile());
|
| - ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_);
|
| -
|
| - UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/");
|
| - TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService();
|
| - pref_service->SetUserPref(prefs::kLastPromptedGoogleURL,
|
| - new base::StringValue("https://www.google.com/"));
|
| - SetDefaultSearchProvider("{google:baseURL}");
|
| - instant_service_ = InstantServiceFactory::GetForProfile(profile());
|
| + SetUpHelper();
|
| }
|
|
|
| void InstantUnitTestBase::TearDown() {
|
| @@ -59,6 +43,12 @@ void InstantUnitTestBase::TearDown() {
|
| BrowserWithTestWindowTest::TearDown();
|
| }
|
|
|
| +#if !defined(OS_IOS) && !defined(OS_ANDROID)
|
| +void InstantUnitTestBase::SetUpWithoutQueryExtraction() {
|
| + SetUpHelper();
|
| +}
|
| +#endif
|
| +
|
| void InstantUnitTestBase::SetDefaultSearchProvider(
|
| const std::string& base_url) {
|
| TemplateURLData data;
|
| @@ -92,9 +82,23 @@ void InstantUnitTestBase::NotifyGoogleBaseURLUpdate(
|
| content::Details<GoogleURLTracker::UpdatedDetails>(&details));
|
| }
|
|
|
| -
|
| bool InstantUnitTestBase::IsInstantServiceObserver(
|
| InstantServiceObserver* observer) {
|
| return instant_service_->observers_.HasObserver(observer);
|
| }
|
|
|
| +void InstantUnitTestBase::SetUpHelper() {
|
| + BrowserWithTestWindowTest::SetUp();
|
| +
|
| + TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
|
| + profile(), &TemplateURLServiceFactory::BuildInstanceFor);
|
| + template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile());
|
| + ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_);
|
| +
|
| + UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/");
|
| + TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService();
|
| + pref_service->SetUserPref(prefs::kLastPromptedGoogleURL,
|
| + new base::StringValue("https://www.google.com/"));
|
| + SetDefaultSearchProvider("{google:baseURL}");
|
| + instant_service_ = InstantServiceFactory::GetForProfile(profile());
|
| +}
|
|
|