OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
11 #include "chrome/browser/autocomplete/autocomplete_match.h" | 11 #include "chrome/browser/autocomplete/autocomplete_match.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 TemplateURL* default_t_url = new TemplateURL(); | 170 TemplateURL* default_t_url = new TemplateURL(); |
171 default_t_url->SetURL("http://defaultturl/{searchTerms}", 0, 0); | 171 default_t_url->SetURL("http://defaultturl/{searchTerms}", 0, 0); |
172 TemplateURLModel* turl_model = profile_.GetTemplateURLModel(); | 172 TemplateURLModel* turl_model = profile_.GetTemplateURLModel(); |
173 turl_model->Add(default_t_url); | 173 turl_model->Add(default_t_url); |
174 turl_model->SetDefaultSearchProvider(default_t_url); | 174 turl_model->SetDefaultSearchProvider(default_t_url); |
175 TemplateURLID default_provider_id = default_t_url->id(); | 175 TemplateURLID default_provider_id = default_t_url->id(); |
176 ASSERT_NE(0, default_provider_id); | 176 ASSERT_NE(0, default_provider_id); |
177 | 177 |
178 // Create another TemplateURL for KeywordProvider. | 178 // Create another TemplateURL for KeywordProvider. |
179 TemplateURL* keyword_t_url = new TemplateURL(); | 179 TemplateURL* keyword_t_url = new TemplateURL(); |
180 keyword_t_url->set_short_name(L"k"); | 180 keyword_t_url->set_short_name(ASCIIToUTF16("k")); |
181 keyword_t_url->set_keyword(L"k"); | 181 keyword_t_url->set_keyword(ASCIIToUTF16("k")); |
182 keyword_t_url->SetURL("http://keyword/{searchTerms}", 0, 0); | 182 keyword_t_url->SetURL("http://keyword/{searchTerms}", 0, 0); |
183 profile_.GetTemplateURLModel()->Add(keyword_t_url); | 183 profile_.GetTemplateURLModel()->Add(keyword_t_url); |
184 ASSERT_NE(0, keyword_t_url->id()); | 184 ASSERT_NE(0, keyword_t_url->id()); |
185 | 185 |
186 // Forget about any existing providers. The controller owns them and will | 186 // Forget about any existing providers. The controller owns them and will |
187 // Release() them below, when we delete it during the call to reset(). | 187 // Release() them below, when we delete it during the call to reset(). |
188 providers_.clear(); | 188 providers_.clear(); |
189 | 189 |
190 // Create both a keyword and search provider, and add them in that order. | 190 // Create both a keyword and search provider, and add them in that order. |
191 // (Order is important; see comments in RunExactKeymatchTest().) | 191 // (Order is important; see comments in RunExactKeymatchTest().) |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << | 449 EXPECT_EQ(input_cases[i].scheme.len, scheme.len) << "Input: " << |
450 input_cases[i].input; | 450 input_cases[i].input; |
451 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << | 451 EXPECT_EQ(input_cases[i].host.begin, host.begin) << "Input: " << |
452 input_cases[i].input; | 452 input_cases[i].input; |
453 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << | 453 EXPECT_EQ(input_cases[i].host.len, host.len) << "Input: " << |
454 input_cases[i].input; | 454 input_cases[i].input; |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 } // namespace | 458 } // namespace |
OLD | NEW |