Chromium Code Reviews| 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 a4a74d5a83aff6853d009f386ec659bec01ac044..44694fcac2fe779397ace9d32e6a510a236d19ef 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_model_unittest.cc |
| +++ b/chrome/browser/ui/toolbar/toolbar_model_unittest.cc |
| @@ -151,9 +151,14 @@ class ToolbarModelTest : public BrowserWithTestWindowTest { |
| protected: |
| void ResetDefaultTemplateURL() { |
| + ResetTemplateURLForInstant(GURL("http://does/not/exist")); |
| + } |
| + |
| + void ResetTemplateURLForInstant(const GURL instant_url) { |
|
sreeram
2013/05/01 21:59:50
const GURL&
Shishir
2013/05/01 23:42:16
Done.
|
| TemplateURLData data; |
| + data.short_name = ASCIIToUTF16("Google"); |
| data.SetURL("http://google.com/search?q={searchTerms}"); |
| - data.instant_url = "http://does/not/exist"; |
| + data.instant_url = instant_url.spec(); |
| data.search_terms_replacement_key = "{google:instantExtendedEnabledKey}"; |
| TemplateURL* search_template_url = new TemplateURL(profile(), data); |
| TemplateURLService* template_url_service = |
| @@ -205,18 +210,15 @@ class ToolbarModelTest : public BrowserWithTestWindowTest { |
| const string16 expected_text, |
| ToolbarModel::SearchTermsType search_terms_type, |
| bool should_display) { |
| + // The URL being navigate to should be treated as the Instant URL. Else |
|
sreeram
2013/05/01 21:59:50
navigate -> navigated
Shishir
2013/05/01 23:42:16
Done.
|
| + // there will be no search term extraction. |
| + ResetTemplateURLForInstant(url); |
| + |
| WebContents* contents = browser()->tab_strip_model()->GetWebContentsAt(0); |
| browser()->OpenURL(OpenURLParams( |
| 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. |