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

Side by Side Diff: chrome/browser/search/instant_unittest_base.cc

Issue 268643002: Use the DefaultSearchManager as the exclusive authority on DSE, ignoring Web Data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last test fix? Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 chrome::NOTIFICATION_GOOGLE_URL_UPDATED, 80 chrome::NOTIFICATION_GOOGLE_URL_UPDATED,
81 content::Source<Profile>(profile()->GetOriginalProfile()), 81 content::Source<Profile>(profile()->GetOriginalProfile()),
82 content::Details<GoogleURLTracker::UpdatedDetails>(&details)); 82 content::Details<GoogleURLTracker::UpdatedDetails>(&details));
83 } 83 }
84 84
85 bool InstantUnitTestBase::IsInstantServiceObserver( 85 bool InstantUnitTestBase::IsInstantServiceObserver(
86 InstantServiceObserver* observer) { 86 InstantServiceObserver* observer) {
87 return instant_service_->observers_.HasObserver(observer); 87 return instant_service_->observers_.HasObserver(observer);
88 } 88 }
89 89
90 TestingProfile* InstantUnitTestBase::CreateProfile() {
91 TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile();
92 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
93 profile, &TemplateURLServiceFactory::BuildInstanceFor);
94 return profile;
95 }
96
90 void InstantUnitTestBase::SetUpHelper() { 97 void InstantUnitTestBase::SetUpHelper() {
91 BrowserWithTestWindowTest::SetUp(); 98 BrowserWithTestWindowTest::SetUp();
92 99
93 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
94 profile(), &TemplateURLServiceFactory::BuildInstanceFor);
95 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile()); 100 template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile());
96 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_); 101 ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_);
97 102
98 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/"); 103 UIThreadSearchTermsData::SetGoogleBaseURL("https://www.google.com/");
99 TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService(); 104 TestingPrefServiceSyncable* pref_service = profile()->GetTestingPrefService();
100 pref_service->SetUserPref(prefs::kLastPromptedGoogleURL, 105 pref_service->SetUserPref(prefs::kLastPromptedGoogleURL,
101 new base::StringValue("https://www.google.com/")); 106 new base::StringValue("https://www.google.com/"));
102 SetUserSelectedDefaultSearchProvider("{google:baseURL}"); 107 SetUserSelectedDefaultSearchProvider("{google:baseURL}");
103 instant_service_ = InstantServiceFactory::GetForProfile(profile()); 108 instant_service_ = InstantServiceFactory::GetForProfile(profile());
104 } 109 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698