OLD | NEW |
---|---|
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 ASCIIToUTF16("searchurl/?q=tractor+supply"), | 78 ASCIIToUTF16("searchurl/?q=tractor+supply"), |
79 ASCIIToUTF16("searchurl/?q=tractor+supply"), | 79 ASCIIToUTF16("searchurl/?q=tractor+supply"), |
80 ASCIIToUTF16("searchurl/?q=tractor+supply"), | 80 ASCIIToUTF16("searchurl/?q=tractor+supply"), |
81 false, | 81 false, |
82 true | 82 true |
83 }, | 83 }, |
84 { | 84 { |
85 GURL("http://google.com/search?q=tractor+supply"), | 85 GURL("http://google.com/search?q=tractor+supply"), |
86 ASCIIToUTF16("google.com/search?q=tractor+supply"), | 86 ASCIIToUTF16("google.com/search?q=tractor+supply"), |
87 ASCIIToUTF16("google.com/search?q=tractor+supply"), | 87 ASCIIToUTF16("google.com/search?q=tractor+supply"), |
88 ASCIIToUTF16("google.com/search?q=tractor+supply"), | 88 ASCIIToUTF16("tractor supply"), |
dhollowa
2012/09/19 19:51:03
Hmm. I'm confused. Why did this change?
beaudoin
2012/09/22 06:55:45
Reverted now that espv=1 is required.
| |
89 false, | 89 true, |
90 true | 90 true |
91 }, | 91 }, |
92 { | 92 { |
93 GURL("http://google.com/search?q=tractor+supply&espv=1"), | 93 GURL("http://google.com/search?q=tractor+supply&espv=1"), |
94 ASCIIToUTF16("google.com/search?q=tractor+supply&espv=1"), | 94 ASCIIToUTF16("google.com/search?q=tractor+supply&espv=1"), |
95 ASCIIToUTF16("google.com/search?q=tractor+supply&espv=1"), | 95 ASCIIToUTF16("google.com/search?q=tractor+supply&espv=1"), |
96 ASCIIToUTF16("tractor supply"), | 96 ASCIIToUTF16("tractor supply"), |
97 true, | 97 true, |
98 true | 98 true |
99 } | 99 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 for (size_t i = 0; i < arraysize(test_items); ++i) { | 176 for (size_t i = 0; i < arraysize(test_items); ++i) { |
177 const TestItem& test_item = test_items[i]; | 177 const TestItem& test_item = test_items[i]; |
178 NavigateAndCheckText(test_item.url, | 178 NavigateAndCheckText(test_item.url, |
179 test_item.expected_text, | 179 test_item.expected_text, |
180 test_item.expected_replace_text_inactive, | 180 test_item.expected_replace_text_inactive, |
181 false, | 181 false, |
182 test_item.should_display); | 182 test_item.should_display); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 // Test that we don't replace any URLs when the InstantExtended API is enabled. | 186 // Test that we don't replace any URLs when the InstantExtended API is enabled. |
dhollowa
2012/09/19 19:51:03
This comment seems wrong.
beaudoin
2012/09/22 06:55:45
Done.
| |
187 TEST_F(ToolbarModelTest, ShouldDisplayURLInstantExtendedAPIEnabled) { | 187 TEST_F(ToolbarModelTest, ShouldDisplayURLInstantExtendedAPIEnabled) { |
188 CommandLine::ForCurrentProcess()->AppendSwitch( | 188 CommandLine::ForCurrentProcess()->AppendSwitch( |
189 switches::kEnableInstantExtendedAPI); | 189 switches::kEnableInstantExtendedAPI); |
190 | 190 |
191 ResetDefaultTemplateURL(); | 191 ResetDefaultTemplateURL(); |
192 AddTab(browser(), GURL(chrome::kAboutBlankURL)); | 192 AddTab(browser(), GURL(chrome::kAboutBlankURL)); |
193 for (size_t i = 0; i < arraysize(test_items); ++i) { | 193 for (size_t i = 0; i < arraysize(test_items); ++i) { |
194 const TestItem& test_item = test_items[i]; | 194 const TestItem& test_item = test_items[i]; |
195 NavigateAndCheckText(test_item.url, | 195 NavigateAndCheckText(test_item.url, |
196 test_item.expected_text, | 196 test_item.expected_text, |
197 test_item.expected_replace_text_active, | 197 test_item.expected_replace_text_active, |
198 test_item.would_replace, | 198 test_item.would_replace, |
199 test_item.should_display); | 199 test_item.should_display); |
200 } | 200 } |
201 } | 201 } |
OLD | NEW |