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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/search_engines/search_terms_data.h" | 10 #include "chrome/browser/search_engines/search_terms_data.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 t_urls[0]->alternate_urls()[0]); | 160 t_urls[0]->alternate_urls()[0]); |
161 EXPECT_EQ("espv", t_urls[0]->search_terms_replacement_key()); | 161 EXPECT_EQ("espv", t_urls[0]->search_terms_replacement_key()); |
162 | 162 |
163 // Test that subsequent providers are loaded even if an intermediate | 163 // Test that subsequent providers are loaded even if an intermediate |
164 // provider has an incomplete configuration. | 164 // provider has an incomplete configuration. |
165 overrides = new ListValue; | 165 overrides = new ListValue; |
166 overrides->Append(entry->DeepCopy()); | 166 overrides->Append(entry->DeepCopy()); |
167 entry->SetInteger("id", 1002); | 167 entry->SetInteger("id", 1002); |
168 entry->SetString("name", "bar"); | 168 entry->SetString("name", "bar"); |
169 entry->SetString("keyword", "bark"); | 169 entry->SetString("keyword", "bark"); |
170 entry->SetString("encoding", ""); | 170 entry->SetString("encoding", std::string()); |
171 overrides->Append(entry->DeepCopy()); | 171 overrides->Append(entry->DeepCopy()); |
172 entry->SetInteger("id", 1003); | 172 entry->SetInteger("id", 1003); |
173 entry->SetString("name", "baz"); | 173 entry->SetString("name", "baz"); |
174 entry->SetString("keyword", "bazk"); | 174 entry->SetString("keyword", "bazk"); |
175 entry->SetString("encoding", "UTF-8"); | 175 entry->SetString("encoding", "UTF-8"); |
176 overrides->Append(entry->DeepCopy()); | 176 overrides->Append(entry->DeepCopy()); |
177 prefs->SetUserPref(prefs::kSearchProviderOverrides, overrides); | 177 prefs->SetUserPref(prefs::kSearchProviderOverrides, overrides); |
178 | 178 |
179 t_urls.clear(); | 179 t_urls.clear(); |
180 TemplateURLPrepopulateData::GetPrepopulatedEngines(&profile, &t_urls.get(), | 180 TemplateURLPrepopulateData::GetPrepopulatedEngines(&profile, &t_urls.get(), |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 TEST(TemplateURLPrepopulateDataTest, GetLogoURLInvalid) { | 296 TEST(TemplateURLPrepopulateDataTest, GetLogoURLInvalid) { |
297 TemplateURLData data; | 297 TemplateURLData data; |
298 data.SetURL("http://invalid:search:url/"); | 298 data.SetURL("http://invalid:search:url/"); |
299 TemplateURL turl(NULL, data); | 299 TemplateURL turl(NULL, data); |
300 GURL logo_url = TemplateURLPrepopulateData::GetLogoURL( | 300 GURL logo_url = TemplateURLPrepopulateData::GetLogoURL( |
301 turl, TemplateURLPrepopulateData::LOGO_100_PERCENT); | 301 turl, TemplateURLPrepopulateData::LOGO_100_PERCENT); |
302 | 302 |
303 EXPECT_TRUE(logo_url.is_empty()); | 303 EXPECT_TRUE(logo_url.is_empty()); |
304 } | 304 } |
OLD | NEW |