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

Unified Diff: chrome/browser/ui/toolbar/toolbar_model_unittest.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/ui/toolbar/toolbar_model_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_model_unittest.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
index 926cb8ca7f904ba6e1d09484fca17196698f5fb3..7ba2409d80de23fe1bb135fc57a6acb3b571a564 100644
--- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc
@@ -6,6 +6,8 @@
#include "base/command_line.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/instant/instant_service.h"
+#include "chrome/browser/instant/instant_service_factory.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -15,6 +17,7 @@
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/browser_with_test_window_test.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
@@ -126,6 +129,7 @@ class ToolbarModelTest : public BrowserWithTestWindowTest {
void ResetDefaultTemplateURL() {
TemplateURLData data;
data.SetURL("http://google.com/search?q={searchTerms}");
+ data.instant_url = "http://does/not/exist";
data.search_terms_replacement_key = "{google:instantExtendedEnabledKey}";
TemplateURL* search_template_url = new TemplateURL(profile(), data);
TemplateURLService* template_url_service =
@@ -158,6 +162,13 @@ class ToolbarModelTest : public BrowserWithTestWindowTest {
url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED,
false));
+ // Query terms replacement requires that the renderer process be a
+ // recognized Instant renderer. Fake it.
+ InstantService* instant_service =
+ InstantServiceFactory::GetForProfile(profile());
+ int process_id = contents->GetRenderProcessHost()->GetID();
+ instant_service->AddInstantProcess(process_id);
+
ToolbarModel* toolbar_model = browser()->toolbar_model();
// Check while loading.
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698