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

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model_unittest.cc

Issue 11576044: Remove call to IsInstantExtendedAPIGoogleSearchUrl from ToolbarModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed browser tests Created 7 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/toolbar/toolbar_model.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/search_engines/template_url.h" 9 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/browser/search_engines/template_url_service.h" 10 #include "chrome/browser/search_engines/template_url_service.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( 119 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
120 profile(), &TemplateURLServiceFactory::BuildInstanceFor); 120 profile(), &TemplateURLServiceFactory::BuildInstanceFor);
121 } 121 }
122 virtual void TearDown() OVERRIDE { BrowserWithTestWindowTest::TearDown(); } 122 virtual void TearDown() OVERRIDE { BrowserWithTestWindowTest::TearDown(); }
123 123
124 protected: 124 protected:
125 125
126 void ResetDefaultTemplateURL() { 126 void ResetDefaultTemplateURL() {
127 TemplateURLData data; 127 TemplateURLData data;
128 data.SetURL("http://google.com/search?q={searchTerms}"); 128 data.SetURL("http://google.com/search?q={searchTerms}");
129 data.search_terms_replacement_key = "{google:instantExtendedEnabledKey}";
129 TemplateURL* search_template_url = new TemplateURL(profile(), data); 130 TemplateURL* search_template_url = new TemplateURL(profile(), data);
130 TemplateURLService* template_url_service = 131 TemplateURLService* template_url_service =
131 TemplateURLServiceFactory::GetForProfile(profile()); 132 TemplateURLServiceFactory::GetForProfile(profile());
132 template_url_service->Add(search_template_url); 133 template_url_service->Add(search_template_url);
133 template_url_service->SetDefaultSearchProvider(search_template_url); 134 template_url_service->SetDefaultSearchProvider(search_template_url);
134 ASSERT_NE(0, search_template_url->id()); 135 ASSERT_NE(0, search_template_url->id());
135 template_url_service->Load(); 136 template_url_service->Load();
136 } 137 }
137 138
138 void NavigateAndCheckText(const GURL& url, 139 void NavigateAndCheckText(const GURL& url,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 AddTab(browser(), GURL(chrome::kAboutBlankURL)); 200 AddTab(browser(), GURL(chrome::kAboutBlankURL));
200 for (size_t i = 0; i < arraysize(test_items); ++i) { 201 for (size_t i = 0; i < arraysize(test_items); ++i) {
201 const TestItem& test_item = test_items[i]; 202 const TestItem& test_item = test_items[i];
202 NavigateAndCheckText(test_item.url, 203 NavigateAndCheckText(test_item.url,
203 test_item.expected_text, 204 test_item.expected_text,
204 test_item.expected_replace_text_active, 205 test_item.expected_replace_text_active,
205 test_item.would_replace, 206 test_item.would_replace,
206 test_item.should_display); 207 test_item.should_display);
207 } 208 }
208 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698