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

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

Issue 10908226: Introduces a search term extraction mechanism working for arbitrary search providers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed need for espv=1 for search term extraction. Created 8 years, 2 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 for (size_t i = 0; i < arraysize(test_items); ++i) { 177 for (size_t i = 0; i < arraysize(test_items); ++i) {
178 const TestItem& test_item = test_items[i]; 178 const TestItem& test_item = test_items[i];
179 NavigateAndCheckText(test_item.url, 179 NavigateAndCheckText(test_item.url,
180 test_item.expected_text, 180 test_item.expected_text,
181 test_item.expected_replace_text_inactive, 181 test_item.expected_replace_text_inactive,
182 false, 182 false,
183 test_item.should_display); 183 test_item.should_display);
184 } 184 }
185 } 185 }
186 186
187 // Test that we don't replace any URLs when the InstantExtended API is enabled. 187 // Test that we replace URLs when the InstantExtended API is enabled.
188 TEST_F(ToolbarModelTest, ShouldDisplayURLInstantExtendedAPIEnabled) { 188 TEST_F(ToolbarModelTest, ShouldDisplayURLInstantExtendedAPIEnabled) {
189 CommandLine::ForCurrentProcess()->AppendSwitch( 189 CommandLine::ForCurrentProcess()->AppendSwitch(
190 switches::kEnableInstantExtendedAPI); 190 switches::kEnableInstantExtendedAPI);
191 191
192 // Avoid tests on branded Chrome where channel is set to CHANNEL_STABLE. 192 // Avoid tests on branded Chrome where channel is set to CHANNEL_STABLE.
193 if (!chrome::search::IsInstantExtendedAPIEnabled(profile())) 193 if (!chrome::search::IsInstantExtendedAPIEnabled(profile()))
194 return; 194 return;
195 195
196 ResetDefaultTemplateURL(); 196 ResetDefaultTemplateURL();
197 AddTab(browser(), GURL(chrome::kAboutBlankURL)); 197 AddTab(browser(), GURL(chrome::kAboutBlankURL));
198 for (size_t i = 0; i < arraysize(test_items); ++i) { 198 for (size_t i = 0; i < arraysize(test_items); ++i) {
199 const TestItem& test_item = test_items[i]; 199 const TestItem& test_item = test_items[i];
200 NavigateAndCheckText(test_item.url, 200 NavigateAndCheckText(test_item.url,
201 test_item.expected_text, 201 test_item.expected_text,
202 test_item.expected_replace_text_active, 202 test_item.expected_replace_text_active,
203 test_item.would_replace, 203 test_item.would_replace,
204 test_item.should_display); 204 test_item.should_display);
205 } 205 }
206 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698