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
3 // found in the LICENSE file.
5 #include "base/command_line.h"
6 #include "base/files/scoped_temp_dir.h"
7 #include "base/memory/scoped_vector.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/search_engines/prepopulated_engines.h"
10 #include "chrome/browser/search_engines/search_terms_data.h"
11 #include "chrome/browser/search_engines/template_url.h"
12 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
13 #include "chrome/browser/search_engines/template_url_service.h"
14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/pref_names.h"
16 #include "chrome/test/base/testing_pref_service_syncable.h"
17 #include "chrome/test/base/testing_profile.h"
18 #include "grit/generated_resources.h"
19 #include "testing/gtest/include/gtest/gtest.h"
20 #include "ui/base/l10n/l10n_util.h"
22 using base::ASCIIToUTF16
;
26 SearchEngineType
GetEngineType(const std::string
& url
) {
29 return TemplateURLPrepopulateData::GetEngineType(TemplateURL(NULL
, data
));
32 std::string
GetHostFromTemplateURLData(const TemplateURLData
& data
) {
33 return TemplateURL(NULL
, data
).url_ref().GetHost();
38 typedef testing::Test TemplateURLPrepopulateDataTest
;
40 // Verifies the set of prepopulate data doesn't contain entries with duplicate
42 TEST(TemplateURLPrepopulateDataTest
, UniqueIDs
) {
43 const int kCountryIds
[] = {
44 'A'<<8|'D', 'A'<<8|'E', 'A'<<8|'F', 'A'<<8|'G', 'A'<<8|'I',
45 'A'<<8|'L', 'A'<<8|'M', 'A'<<8|'N', 'A'<<8|'O', 'A'<<8|'Q',
46 'A'<<8|'R', 'A'<<8|'S', 'A'<<8|'T', 'A'<<8|'U', 'A'<<8|'W',
47 'A'<<8|'X', 'A'<<8|'Z', 'B'<<8|'A', 'B'<<8|'B', 'B'<<8|'D',
48 'B'<<8|'E', 'B'<<8|'F', 'B'<<8|'G', 'B'<<8|'H', 'B'<<8|'I',
49 'B'<<8|'J', 'B'<<8|'M', 'B'<<8|'N', 'B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<<8|'Y', 'S'<<8|'Z', 'T'<<8|'C', 'T'<<8|'D',
86 'T'<<8|'F', 'T'<<8|'G', 'T'<<8|'H', 'T'<<8|'J', 'T'<<8|'K',
87 'T'<<8|'L', 'T'<<8|'M', 'T'<<8|'N', 'T'<<8|'O', 'T'<<8|'R',
88 'T'<<8|'T', 'T'<<8|'V', 'T'<<8|'W', 'T'<<8|'Z', 'U'<<8|'A',
89 'U'<<8|'G', 'U'<<8|'M', 'U'<<8|'S', 'U'<<8|'Y', 'U'<<8|'Z',
90 'V'<<8|'A', 'V'<<8|'C', 'V'<<8|'E', 'V'<<8|'G', 'V'<<8|'I',
91 'V'<<8|'N', 'V'<<8|'U', 'W'<<8|'F', 'W'<<8|'S', 'Y'<<8|'E',
92 'Y'<<8|'T', 'Z'<<8|'A', 'Z'<<8|'M', 'Z'<<8|'W', -1 };
94 TestingProfile profile
;
95 for (size_t i
= 0; i
< arraysize(kCountryIds
); ++i
) {
96 profile
.GetPrefs()->SetInteger(prefs::kCountryIDAtInstall
, kCountryIds
[i
]);
98 ScopedVector
<TemplateURLData
> urls
=
99 TemplateURLPrepopulateData::GetPrepopulatedEngines(profile
.GetPrefs(),
101 std::set
<int> unique_ids
;
102 for (size_t turl_i
= 0; turl_i
< urls
.size(); ++turl_i
) {
103 ASSERT_TRUE(unique_ids
.find(urls
[turl_i
]->prepopulate_id
) ==
105 unique_ids
.insert(urls
[turl_i
]->prepopulate_id
);
110 // Verifies that default search providers from the preferences file
111 // override the built-in ones.
112 TEST(TemplateURLPrepopulateDataTest
, ProvidersFromPrefs
) {
113 TestingProfile profile
;
114 TestingPrefServiceSyncable
* prefs
= profile
.GetTestingPrefService();
115 prefs
->SetUserPref(prefs::kSearchProviderOverridesVersion
,
116 base::Value::CreateIntegerValue(1));
117 base::ListValue
* overrides
= new base::ListValue
;
118 scoped_ptr
<base::DictionaryValue
> entry(new base::DictionaryValue
);
119 // Set only the minimal required settings for a search provider configuration.
120 entry
->SetString("name", "foo");
121 entry
->SetString("keyword", "fook");
122 entry
->SetString("search_url", "http://foo.com/s?q={searchTerms}");
123 entry
->SetString("favicon_url", "http://foi.com/favicon.ico");
124 entry
->SetString("encoding", "UTF-8");
125 entry
->SetInteger("id", 1001);
126 overrides
->Append(entry
->DeepCopy());
127 prefs
->SetUserPref(prefs::kSearchProviderOverrides
, overrides
);
129 int version
= TemplateURLPrepopulateData::GetDataVersion(prefs
);
130 EXPECT_EQ(1, version
);
132 size_t default_index
;
133 ScopedVector
<TemplateURLData
> t_urls
=
134 TemplateURLPrepopulateData::GetPrepopulatedEngines(prefs
, &default_index
);
136 ASSERT_EQ(1u, t_urls
.size());
137 EXPECT_EQ(ASCIIToUTF16("foo"), t_urls
[0]->short_name
);
138 EXPECT_EQ(ASCIIToUTF16("fook"), t_urls
[0]->keyword());
139 EXPECT_EQ("foo.com", GetHostFromTemplateURLData(*t_urls
[0]));
140 EXPECT_EQ("foi.com", t_urls
[0]->favicon_url
.host());
141 EXPECT_EQ(1u, t_urls
[0]->input_encodings
.size());
142 EXPECT_EQ(1001, t_urls
[0]->prepopulate_id
);
143 EXPECT_TRUE(t_urls
[0]->suggestions_url
.empty());
144 EXPECT_TRUE(t_urls
[0]->instant_url
.empty());
145 EXPECT_EQ(0u, t_urls
[0]->alternate_urls
.size());
146 EXPECT_TRUE(t_urls
[0]->search_terms_replacement_key
.empty());
148 // Test the optional settings too.
149 entry
->SetString("suggest_url", "http://foo.com/suggest?q={searchTerms}");
150 entry
->SetString("instant_url", "http://foo.com/instant?q={searchTerms}");
151 base::ListValue
* alternate_urls
= new base::ListValue
;
152 alternate_urls
->AppendString("http://foo.com/alternate?q={searchTerms}");
153 entry
->Set("alternate_urls", alternate_urls
);
154 entry
->SetString("search_terms_replacement_key", "espv");
155 overrides
= new base::ListValue
;
156 overrides
->Append(entry
->DeepCopy());
157 prefs
->SetUserPref(prefs::kSearchProviderOverrides
, overrides
);
159 t_urls
= TemplateURLPrepopulateData::GetPrepopulatedEngines(
160 profile
.GetPrefs(), &default_index
);
161 ASSERT_EQ(1u, t_urls
.size());
162 EXPECT_EQ(ASCIIToUTF16("foo"), t_urls
[0]->short_name
);
163 EXPECT_EQ(ASCIIToUTF16("fook"), t_urls
[0]->keyword());
164 EXPECT_EQ("foo.com", GetHostFromTemplateURLData(*t_urls
[0]));
165 EXPECT_EQ("foi.com", t_urls
[0]->favicon_url
.host());
166 EXPECT_EQ(1u, t_urls
[0]->input_encodings
.size());
167 EXPECT_EQ(1001, t_urls
[0]->prepopulate_id
);
168 EXPECT_EQ("http://foo.com/suggest?q={searchTerms}",
169 t_urls
[0]->suggestions_url
);
170 EXPECT_EQ("http://foo.com/instant?q={searchTerms}",
171 t_urls
[0]->instant_url
);
172 ASSERT_EQ(1u, t_urls
[0]->alternate_urls
.size());
173 EXPECT_EQ("http://foo.com/alternate?q={searchTerms}",
174 t_urls
[0]->alternate_urls
[0]);
175 EXPECT_EQ("espv", t_urls
[0]->search_terms_replacement_key
);
177 // Test that subsequent providers are loaded even if an intermediate
178 // provider has an incomplete configuration.
179 overrides
= new base::ListValue
;
180 overrides
->Append(entry
->DeepCopy());
181 entry
->SetInteger("id", 1002);
182 entry
->SetString("name", "bar");
183 entry
->SetString("keyword", "bark");
184 entry
->SetString("encoding", std::string());
185 overrides
->Append(entry
->DeepCopy());
186 entry
->SetInteger("id", 1003);
187 entry
->SetString("name", "baz");
188 entry
->SetString("keyword", "bazk");
189 entry
->SetString("encoding", "UTF-8");
190 overrides
->Append(entry
->DeepCopy());
191 prefs
->SetUserPref(prefs::kSearchProviderOverrides
, overrides
);
194 TemplateURLPrepopulateData::GetPrepopulatedEngines(prefs
, &default_index
);
195 EXPECT_EQ(2u, t_urls
.size());
198 TEST(TemplateURLPrepopulateDataTest
, ClearProvidersFromPrefs
) {
199 TestingProfile profile
;
200 TestingPrefServiceSyncable
* prefs
= profile
.GetTestingPrefService();
201 prefs
->SetUserPref(prefs::kSearchProviderOverridesVersion
,
202 base::Value::CreateIntegerValue(1));
203 base::ListValue
* overrides
= new base::ListValue
;
204 base::DictionaryValue
* entry(new base::DictionaryValue
);
205 // Set only the minimal required settings for a search provider configuration.
206 entry
->SetString("name", "foo");
207 entry
->SetString("keyword", "fook");
208 entry
->SetString("search_url", "http://foo.com/s?q={searchTerms}");
209 entry
->SetString("favicon_url", "http://foi.com/favicon.ico");
210 entry
->SetString("encoding", "UTF-8");
211 entry
->SetInteger("id", 1001);
212 overrides
->Append(entry
);
213 prefs
->SetUserPref(prefs::kSearchProviderOverrides
, overrides
);
215 int version
= TemplateURLPrepopulateData::GetDataVersion(prefs
);
216 EXPECT_EQ(1, version
);
218 // This call removes the above search engine.
219 TemplateURLPrepopulateData::ClearPrepopulatedEnginesInPrefs(prefs
);
221 version
= TemplateURLPrepopulateData::GetDataVersion(prefs
);
222 EXPECT_EQ(TemplateURLPrepopulateData::kCurrentDataVersion
, version
);
224 size_t default_index
;
225 ScopedVector
<TemplateURLData
> t_urls
=
226 TemplateURLPrepopulateData::GetPrepopulatedEngines(prefs
, &default_index
);
227 ASSERT_FALSE(t_urls
.empty());
228 for (size_t i
= 0; i
< t_urls
.size(); ++i
) {
229 EXPECT_NE(ASCIIToUTF16("foo"), t_urls
[i
]->short_name
);
230 EXPECT_NE(ASCIIToUTF16("fook"), t_urls
[i
]->keyword());
231 EXPECT_NE("foi.com", t_urls
[i
]->favicon_url
.host());
232 EXPECT_NE("foo.com", GetHostFromTemplateURLData(*t_urls
[i
]));
233 EXPECT_NE(1001, t_urls
[i
]->prepopulate_id
);
235 // Ensures the default URL is Google and has the optional fields filled.
236 EXPECT_EQ(ASCIIToUTF16("Google"), t_urls
[default_index
]->short_name
);
237 EXPECT_FALSE(t_urls
[default_index
]->suggestions_url
.empty());
238 EXPECT_FALSE(t_urls
[default_index
]->instant_url
.empty());
239 EXPECT_FALSE(t_urls
[default_index
]->image_url
.empty());
240 EXPECT_FALSE(t_urls
[default_index
]->new_tab_url
.empty());
241 EXPECT_FALSE(t_urls
[default_index
]->image_url_post_params
.empty());
242 EXPECT_EQ(SEARCH_ENGINE_GOOGLE
,
243 TemplateURLPrepopulateData::GetEngineType(
244 TemplateURL(NULL
, *t_urls
[default_index
])));
247 // Verifies that built-in search providers are processed correctly.
248 TEST(TemplateURLPrepopulateDataTest
, ProvidersFromPrepopulated
) {
249 TestingProfile profile
;
250 // Use United States.
251 profile
.GetPrefs()->SetInteger(prefs::kCountryIDAtInstall
, 'U'<<8|'S');
252 size_t default_index
;
253 ScopedVector
<TemplateURLData
> t_urls
=
254 TemplateURLPrepopulateData::GetPrepopulatedEngines(profile
.GetPrefs(),
257 // Ensure all the URLs have the required fields populated.
258 ASSERT_FALSE(t_urls
.empty());
259 for (size_t i
= 0; i
< t_urls
.size(); ++i
) {
260 ASSERT_FALSE(t_urls
[i
]->short_name
.empty());
261 ASSERT_FALSE(t_urls
[i
]->keyword().empty());
262 ASSERT_FALSE(t_urls
[i
]->favicon_url
.host().empty());
263 ASSERT_FALSE(GetHostFromTemplateURLData(*t_urls
[i
]).empty());
264 ASSERT_FALSE(t_urls
[i
]->input_encodings
.empty());
265 EXPECT_GT(t_urls
[i
]->prepopulate_id
, 0);
268 // Ensures the default URL is Google and has the optional fields filled.
269 EXPECT_EQ(ASCIIToUTF16("Google"), t_urls
[default_index
]->short_name
);
270 EXPECT_FALSE(t_urls
[default_index
]->suggestions_url
.empty());
271 EXPECT_FALSE(t_urls
[default_index
]->instant_url
.empty());
272 EXPECT_FALSE(t_urls
[default_index
]->image_url
.empty());
273 EXPECT_FALSE(t_urls
[default_index
]->new_tab_url
.empty());
274 EXPECT_FALSE(t_urls
[default_index
]->image_url_post_params
.empty());
275 // Expect at least 2 alternate_urls.
276 // This caught a bug with static initialization of arrays, so leave this in.
277 EXPECT_GT(t_urls
[default_index
]->alternate_urls
.size(), 1u);
278 for (size_t i
= 0; i
< t_urls
[default_index
]->alternate_urls
.size(); ++i
)
279 EXPECT_FALSE(t_urls
[default_index
]->alternate_urls
[i
].empty());
280 EXPECT_EQ(SEARCH_ENGINE_GOOGLE
,
281 TemplateURLPrepopulateData::GetEngineType(
282 TemplateURL(NULL
, *t_urls
[default_index
])));
283 EXPECT_FALSE(t_urls
[default_index
]->search_terms_replacement_key
.empty());
286 TEST(TemplateURLPrepopulateDataTest
, GetEngineTypeBasic
) {
287 EXPECT_EQ(SEARCH_ENGINE_OTHER
, GetEngineType("http://example.com/"));
288 EXPECT_EQ(SEARCH_ENGINE_ASK
, GetEngineType("http://www.ask.com/"));
289 EXPECT_EQ(SEARCH_ENGINE_OTHER
, GetEngineType("http://search.atlas.cz/"));
290 EXPECT_EQ(SEARCH_ENGINE_GOOGLE
, GetEngineType("http://www.google.com/"));
293 TEST(TemplateURLPrepopulateDataTest
, GetEngineTypeAdvanced
) {
294 // Google URLs in different forms.
295 const char* kGoogleURLs
[] = {
296 // Original with google:baseURL:
297 "{google:baseURL}search?q={searchTerms}&{google:RLZ}"
298 "{google:originalQueryForSuggestion}{google:searchFieldtrialParameter}"
299 "sourceid=chrome&ie={inputEncoding}",
300 // Custom with google.com and reordered query params:
301 "http://google.com/search?{google:RLZ}{google:originalQueryForSuggestion}"
302 "{google:searchFieldtrialParameter}"
303 "sourceid=chrome&ie={inputEncoding}&q={searchTerms}",
304 // Custom with a country TLD and almost no query params:
305 "http://www.google.ru/search?q={searchTerms}"
307 for (size_t i
= 0; i
< arraysize(kGoogleURLs
); ++i
) {
308 EXPECT_EQ(SEARCH_ENGINE_GOOGLE
, GetEngineType(kGoogleURLs
[i
]));
312 const char* kYahooURLs
[] = {
313 "http://search.yahoo.com/search?"
314 "ei={inputEncoding}&fr=crmas&p={searchTerms}",
315 "http://search.yahoo.com/search?p={searchTerms}",
316 // Aggressively match types by checking just TLD+1.
317 "http://someothersite.yahoo.com/",
319 for (size_t i
= 0; i
< arraysize(kYahooURLs
); ++i
) {
320 EXPECT_EQ(SEARCH_ENGINE_YAHOO
, GetEngineType(kYahooURLs
[i
]));
323 // URLs for engines not present in country-specific lists.
324 EXPECT_EQ(SEARCH_ENGINE_NIGMA
,
325 GetEngineType("http://nigma.ru/?s={searchTerms}&arg1=value1"));
326 // Also test matching against alternate URLs (and TLD+1 matching).
327 EXPECT_EQ(SEARCH_ENGINE_SOFTONIC
,
328 GetEngineType("http://test.softonic.com.br/?{searchTerms}"));
330 // Search URL for which no prepopulated search provider exists.
331 EXPECT_EQ(SEARCH_ENGINE_OTHER
,
332 GetEngineType("http://example.net/search?q={searchTerms}"));
333 EXPECT_EQ(SEARCH_ENGINE_OTHER
, GetEngineType("invalid:search:url"));
335 // URL that doesn't look Google-related, but matches a Google base URL
336 // specified on the command line.
337 const std::string
foo_url("http://www.foo.com/search?q={searchTerms}");
338 EXPECT_EQ(SEARCH_ENGINE_OTHER
, GetEngineType(foo_url
));
339 CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kGoogleBaseURL
,
340 "http://www.foo.com/");
341 EXPECT_EQ(SEARCH_ENGINE_GOOGLE
, GetEngineType(foo_url
));
344 TEST(TemplateURLPrepopulateDataTest
, GetLogoURLGoogle
) {
345 TemplateURLData data
;
346 data
.SetURL("http://www.google.com/");
347 TemplateURL
turl(NULL
, data
);
348 GURL logo_100_url
= TemplateURLPrepopulateData::GetLogoURL(
349 turl
, TemplateURLPrepopulateData::LOGO_100_PERCENT
);
350 GURL logo_200_url
= TemplateURLPrepopulateData::GetLogoURL(
351 turl
, TemplateURLPrepopulateData::LOGO_200_PERCENT
);
353 EXPECT_EQ("www.google.com", logo_100_url
.host());
354 EXPECT_EQ("www.google.com", logo_200_url
.host());
355 EXPECT_NE(logo_100_url
, logo_200_url
);
358 TEST(TemplateURLPrepopulateDataTest
, GetLogoURLUnknown
) {
359 TemplateURLData data
;
360 data
.SetURL("http://webalta.ru/");
361 TemplateURL
turl(NULL
, data
);
362 GURL logo_url
= TemplateURLPrepopulateData::GetLogoURL(
363 turl
, TemplateURLPrepopulateData::LOGO_100_PERCENT
);
365 EXPECT_TRUE(logo_url
.is_empty());
368 TEST(TemplateURLPrepopulateDataTest
, GetLogoURLInvalid
) {
369 TemplateURLData data
;
370 data
.SetURL("http://invalid:search:url/");
371 TemplateURL
turl(NULL
, data
);
372 GURL logo_url
= TemplateURLPrepopulateData::GetLogoURL(
373 turl
, TemplateURLPrepopulateData::LOGO_100_PERCENT
);
375 EXPECT_TRUE(logo_url
.is_empty());