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

Unified Diff: chrome/browser/instant/instant_test_utils.cc

Issue 12250033: Consolidate search terms extraction and Instant process determination. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nit Created 7 years, 10 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
« no previous file with comments | « chrome/browser/instant/instant_test_utils.h ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_test_utils.cc
diff --git a/chrome/browser/instant/instant_test_utils.cc b/chrome/browser/instant/instant_test_utils.cc
index 5c179bc0df6b67de8cfa9918347de5a3851f7f9a..9b9396a7e230a133e4f567194993263b4d00a013 100644
--- a/chrome/browser/instant/instant_test_utils.cc
+++ b/chrome/browser/instant/instant_test_utils.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -52,16 +51,6 @@ void InstantTestModelObserver::PreviewStateChanged(const InstantModel& model) {
// InstantTestBase -----------------------------------------------------------
void InstantTestBase::SetupInstant() {
- CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kInstantURL, instant_url_.spec());
- SetupInstantUsingTemplateURL();
-
- // TODO(shishir): Fix this ugly hack.
- instant()->SetInstantEnabled(false, true);
- instant()->SetInstantEnabled(true, false);
-}
-
-void InstantTestBase::SetupInstantUsingTemplateURL() {
TemplateURLService* service =
TemplateURLServiceFactory::GetForProfile(browser()->profile());
ui_test_utils::WaitForTemplateURLServiceToLoad(service);
@@ -77,7 +66,12 @@ void InstantTestBase::SetupInstantUsingTemplateURL() {
TemplateURL* template_url = new TemplateURL(browser()->profile(), data);
service->Add(template_url); // Takes ownership of |template_url|.
service->SetDefaultSearchProvider(template_url);
+
browser()->profile()->GetPrefs()->SetBoolean(prefs::kInstantEnabled, true);
+
+ // TODO(shishir): Fix this ugly hack.
+ instant()->SetInstantEnabled(false, true);
+ instant()->SetInstantEnabled(true, false);
}
void InstantTestBase::KillInstantRenderView() {
« no previous file with comments | « chrome/browser/instant/instant_test_utils.h ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698