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

Unified Diff: chrome/browser/search/instant_unittest_base.cc

Issue 272573004: Handle TemplateURLService load failure better, and make some test correctness fixes that will be ne… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after revert / presubmit fixes. 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 side-by-side diff with in-line comments
Download patch
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 629100934369a6e92fcf3a105e03a90b32ed1a68..d164e4b82c127946ce30334908786340a046067e 100644
--- a/chrome/browser/search/instant_unittest_base.cc
+++ b/chrome/browser/search/instant_unittest_base.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/search/instant_unittest_base.h"
#include <string>
-#include "base/basictypes.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/google/google_url_tracker.h"
#include "chrome/browser/profiles/profile.h"
@@ -52,6 +52,7 @@ void InstantUnitTestBase::SetUpWithoutQueryExtraction() {
void InstantUnitTestBase::SetUserSelectedDefaultSearchProvider(
const std::string& base_url) {
TemplateURLData data;
+ data.SetKeyword(base::UTF8ToUTF16(base_url));
data.SetURL(base_url + "url?bar={searchTerms}");
data.instant_url = base_url +
"instant?{google:omniboxStartMarginParameter}{google:forceInstantResults}"
@@ -87,11 +88,16 @@ bool InstantUnitTestBase::IsInstantServiceObserver(
return instant_service_->observers_.HasObserver(observer);
}
+TestingProfile* InstantUnitTestBase::CreateProfile() {
+ TestingProfile* profile = BrowserWithTestWindowTest::CreateProfile();
+ TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
+ profile, &TemplateURLServiceFactory::BuildInstanceFor);
+ return profile;
+}
+
void InstantUnitTestBase::SetUpHelper() {
BrowserWithTestWindowTest::SetUp();
- TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
- profile(), &TemplateURLServiceFactory::BuildInstanceFor);
template_url_service_ = TemplateURLServiceFactory::GetForProfile(profile());
ui_test_utils::WaitForTemplateURLServiceToLoad(template_url_service_);
« no previous file with comments | « chrome/browser/search/instant_unittest_base.h ('k') | chrome/browser/search_engines/default_search_pref_migration_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698