OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/instant_unittest_base.h" | 5 #include "chrome/browser/search/instant_unittest_base.h" |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/google/google_url_tracker.h" | 10 #include "chrome/browser/google/google_url_tracker.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 SetUpHelper(); | 37 SetUpHelper(); |
38 } | 38 } |
39 | 39 |
40 void InstantUnitTestBase::SetUpWithoutCacheableNTP() { | 40 void InstantUnitTestBase::SetUpWithoutCacheableNTP() { |
41 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( | 41 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( |
42 "InstantExtended", "Group1 use_cacheable_ntp:0")); | 42 "InstantExtended", "Group1 use_cacheable_ntp:0")); |
43 SetUpHelper(); | 43 SetUpHelper(); |
44 } | 44 } |
45 | 45 |
46 void InstantUnitTestBase::SetUpHelper() { | 46 void InstantUnitTestBase::SetUpHelper() { |
47 chrome::EnableInstantExtendedAPIForTesting(); | 47 chrome::EnableQueryExtractionForTesting(); |
48 BrowserWithTestWindowTest::SetUp(); | 48 BrowserWithTestWindowTest::SetUp(); |
49 | 49 |
50 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 50 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
51 profile(), &TemplateURLServiceFactory::BuildInstanceFor); | 51 profile(), &TemplateURLServiceFactory::BuildInstanceFor); |
52 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); | 52 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); |
53 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); | 53 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); |
54 | 54 |
55 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); | 55 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); |
56 TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService(); | 56 TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService(); |
57 pref_service->SetUserPref(prefs::kLastPromptedGoogleURL, | 57 pref_service->SetUserPref(prefs::kLastPromptedGoogleURL, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 content::Source<Profile>(profile()->GetOriginalProfile()), | 96 content::Source<Profile>(profile()->GetOriginalProfile()), |
97 content::Details<GoogleURLTracker::UpdatedDetails>(&details)); | 97 content::Details<GoogleURLTracker::UpdatedDetails>(&details)); |
98 } | 98 } |
99 | 99 |
100 | 100 |
101 bool InstantUnitTestBase::IsInstantServiceObserver( | 101 bool InstantUnitTestBase::IsInstantServiceObserver( |
102 InstantServiceObserver* observer) { | 102 InstantServiceObserver* observer) { |
103 return instant_service_->observers_.HasObserver(observer); | 103 return instant_service_->observers_.HasObserver(observer); |
104 } | 104 } |
105 | 105 |
OLD | NEW |