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

Side by Side Diff: chrome/browser/search_engines/template_url_service_sync_unittest.cc

Issue 2067723002: [sync] Search engine shortcuts get underscores at the end after sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added requested comments Created 4 years, 6 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
« no previous file with comments | « no previous file | components/search_engines/template_url_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Extract the keyword from a search engine syncer::SyncData. 53 // Extract the keyword from a search engine syncer::SyncData.
54 std::string GetKeyword(const syncer::SyncData& sync_data) { 54 std::string GetKeyword(const syncer::SyncData& sync_data) {
55 return sync_data.GetSpecifics().search_engine().keyword(); 55 return sync_data.GetSpecifics().search_engine().keyword();
56 } 56 }
57 57
58 // Much like TemplateURLService::CreateSyncDataFromTemplateURL(), but allows the 58 // Much like TemplateURLService::CreateSyncDataFromTemplateURL(), but allows the
59 // caller to override the keyword, URL, or GUID fields with empty strings, in 59 // caller to override the keyword, URL, or GUID fields with empty strings, in
60 // order to create custom data that should be handled specially when synced to a 60 // order to create custom data that should be handled specially when synced to a
61 // client. 61 // client.
62 syncer::SyncData CreateCustomSyncData(const TemplateURL& turl, 62 syncer::SyncData CreateCustomSyncData(const TemplateURL& turl,
63 bool autogenerate_keyword, 63 bool autogenerate_keyword,
64 const std::string& url, 64 const std::string& url,
65 const std::string& sync_guid) { 65 const std::string& sync_guid,
66 int prepopulate_id = -1) {
66 sync_pb::EntitySpecifics specifics; 67 sync_pb::EntitySpecifics specifics;
67 sync_pb::SearchEngineSpecifics* se_specifics = 68 sync_pb::SearchEngineSpecifics* se_specifics =
68 specifics.mutable_search_engine(); 69 specifics.mutable_search_engine();
69 se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name())); 70 se_specifics->set_short_name(base::UTF16ToUTF8(turl.short_name()));
70 se_specifics->set_keyword( 71 se_specifics->set_keyword(
71 autogenerate_keyword ? std::string() : base::UTF16ToUTF8(turl.keyword())); 72 autogenerate_keyword ? std::string() : base::UTF16ToUTF8(turl.keyword()));
72 se_specifics->set_favicon_url(turl.favicon_url().spec()); 73 se_specifics->set_favicon_url(turl.favicon_url().spec());
73 se_specifics->set_url(url); 74 se_specifics->set_url(url);
74 se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace()); 75 se_specifics->set_safe_for_autoreplace(turl.safe_for_autoreplace());
75 se_specifics->set_originating_url(turl.originating_url().spec()); 76 se_specifics->set_originating_url(turl.originating_url().spec());
76 se_specifics->set_date_created(turl.date_created().ToInternalValue()); 77 se_specifics->set_date_created(turl.date_created().ToInternalValue());
77 se_specifics->set_input_encodings( 78 se_specifics->set_input_encodings(
78 base::JoinString(turl.input_encodings(), ";")); 79 base::JoinString(turl.input_encodings(), ";"));
79 se_specifics->set_show_in_default_list(turl.show_in_default_list()); 80 se_specifics->set_show_in_default_list(turl.show_in_default_list());
80 se_specifics->set_suggestions_url(turl.suggestions_url()); 81 se_specifics->set_suggestions_url(turl.suggestions_url());
81 se_specifics->set_prepopulate_id(turl.prepopulate_id()); 82 se_specifics->set_prepopulate_id(prepopulate_id == -1 ? turl.prepopulate_id()
83 : prepopulate_id);
82 se_specifics->set_autogenerate_keyword(autogenerate_keyword); 84 se_specifics->set_autogenerate_keyword(autogenerate_keyword);
83 se_specifics->set_instant_url(turl.instant_url()); 85 se_specifics->set_instant_url(turl.instant_url());
84 se_specifics->set_last_modified(turl.last_modified().ToInternalValue()); 86 se_specifics->set_last_modified(turl.last_modified().ToInternalValue());
85 se_specifics->set_sync_guid(sync_guid); 87 se_specifics->set_sync_guid(sync_guid);
86 return syncer::SyncData::CreateLocalData(turl.sync_guid(), // Must be valid! 88 return syncer::SyncData::CreateLocalData(turl.sync_guid(), // Must be valid!
87 se_specifics->keyword(), specifics); 89 se_specifics->keyword(), specifics);
88 } 90 }
89 91
90 92
91 // TestChangeProcessor -------------------------------------------------------- 93 // TestChangeProcessor --------------------------------------------------------
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 std::unique_ptr<syncer::SyncChangeProcessor> PassProcessor(); 204 std::unique_ptr<syncer::SyncChangeProcessor> PassProcessor();
203 std::unique_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory(); 205 std::unique_ptr<syncer::SyncErrorFactory> CreateAndPassSyncErrorFactory();
204 206
205 // Creates a TemplateURL with some test values. The caller owns the returned 207 // Creates a TemplateURL with some test values. The caller owns the returned
206 // TemplateURL*. 208 // TemplateURL*.
207 TemplateURL* CreateTestTemplateURL(const base::string16& keyword, 209 TemplateURL* CreateTestTemplateURL(const base::string16& keyword,
208 const std::string& url, 210 const std::string& url,
209 const std::string& guid = std::string(), 211 const std::string& guid = std::string(),
210 time_t last_mod = 100, 212 time_t last_mod = 100,
211 bool safe_for_autoreplace = false, 213 bool safe_for_autoreplace = false,
212 bool created_by_policy = false) const; 214 bool created_by_policy = false,
215 int prepopulate_id = 999999) const;
213 216
214 // Verifies the two TemplateURLs are equal. 217 // Verifies the two TemplateURLs are equal.
215 // TODO(stevet): Share this with TemplateURLServiceTest. 218 // TODO(stevet): Share this with TemplateURLServiceTest.
216 void AssertEquals(const TemplateURL& expected, 219 void AssertEquals(const TemplateURL& expected,
217 const TemplateURL& actual) const; 220 const TemplateURL& actual) const;
218 221
219 // Expect that two syncer::SyncDataLists have equal contents, in terms of the 222 // Expect that two syncer::SyncDataLists have equal contents, in terms of the
220 // sync_guid, keyword, and url fields. 223 // sync_guid, keyword, and url fields.
221 void AssertEquals(const syncer::SyncDataList& data1, 224 void AssertEquals(const syncer::SyncDataList& data1,
222 const syncer::SyncDataList& data2) const; 225 const syncer::SyncDataList& data2) const;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return std::unique_ptr<syncer::SyncErrorFactory>( 292 return std::unique_ptr<syncer::SyncErrorFactory>(
290 new syncer::SyncErrorFactoryMock()); 293 new syncer::SyncErrorFactoryMock());
291 } 294 }
292 295
293 TemplateURL* TemplateURLServiceSyncTest::CreateTestTemplateURL( 296 TemplateURL* TemplateURLServiceSyncTest::CreateTestTemplateURL(
294 const base::string16& keyword, 297 const base::string16& keyword,
295 const std::string& url, 298 const std::string& url,
296 const std::string& guid, 299 const std::string& guid,
297 time_t last_mod, 300 time_t last_mod,
298 bool safe_for_autoreplace, 301 bool safe_for_autoreplace,
299 bool created_by_policy) const { 302 bool created_by_policy,
303 int prepopulate_id) const {
300 TemplateURLData data; 304 TemplateURLData data;
301 data.SetShortName(ASCIIToUTF16("unittest")); 305 data.SetShortName(ASCIIToUTF16("unittest"));
302 data.SetKeyword(keyword); 306 data.SetKeyword(keyword);
303 data.SetURL(url); 307 data.SetURL(url);
304 data.favicon_url = GURL("http://favicon.url"); 308 data.favicon_url = GURL("http://favicon.url");
305 data.safe_for_autoreplace = safe_for_autoreplace; 309 data.safe_for_autoreplace = safe_for_autoreplace;
306 data.date_created = Time::FromTimeT(100); 310 data.date_created = Time::FromTimeT(100);
307 data.last_modified = Time::FromTimeT(last_mod); 311 data.last_modified = Time::FromTimeT(last_mod);
308 data.created_by_policy = created_by_policy; 312 data.created_by_policy = created_by_policy;
309 data.prepopulate_id = 999999; 313 data.prepopulate_id = prepopulate_id;
310 if (!guid.empty()) 314 if (!guid.empty())
311 data.sync_guid = guid; 315 data.sync_guid = guid;
312 return new TemplateURL(data); 316 return new TemplateURL(data);
313 } 317 }
314 318
315 void TemplateURLServiceSyncTest::AssertEquals(const TemplateURL& expected, 319 void TemplateURLServiceSyncTest::AssertEquals(const TemplateURL& expected,
316 const TemplateURL& actual) const { 320 const TemplateURL& actual) const {
317 ASSERT_EQ(expected.short_name(), actual.short_name()); 321 ASSERT_EQ(expected.short_name(), actual.short_name());
318 ASSERT_EQ(expected.keyword(), actual.keyword()); 322 ASSERT_EQ(expected.keyword(), actual.keyword());
319 ASSERT_EQ(expected.url(), actual.url()); 323 ASSERT_EQ(expected.url(), actual.url());
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 ASCIIToUTF16("localkey"), "www.local.com", "localguid", 528 ASCIIToUTF16("localkey"), "www.local.com", "localguid",
525 test_cases[i].local_time, true, test_cases[i].local_created_by_policy); 529 test_cases[i].local_time, true, test_cases[i].local_created_by_policy);
526 model()->Add(local_turl); 530 model()->Add(local_turl);
527 if (test_cases[i].local_is_default) 531 if (test_cases[i].local_is_default)
528 model()->SetUserSelectedDefaultSearchProvider(local_turl); 532 model()->SetUserSelectedDefaultSearchProvider(local_turl);
529 533
530 std::unique_ptr<TemplateURL> sync_turl( 534 std::unique_ptr<TemplateURL> sync_turl(
531 CreateTestTemplateURL(ASCIIToUTF16("synckey"), "www.sync.com", 535 CreateTestTemplateURL(ASCIIToUTF16("synckey"), "www.sync.com",
532 "syncguid", test_cases[i].sync_time)); 536 "syncguid", test_cases[i].sync_time));
533 EXPECT_EQ(test_cases[i].expected_result, 537 EXPECT_EQ(test_cases[i].expected_result,
534 model()->IsLocalTemplateURLBetter(local_turl, sync_turl.get())); 538 model()->IsLocalTemplateURLBetter(local_turl, sync_turl.get()));
535 539
536 // Undo the changes. 540 // Undo the changes.
537 if (test_cases[i].local_is_default) 541 if (test_cases[i].local_is_default)
538 model()->SetUserSelectedDefaultSearchProvider(NULL); 542 model()->SetUserSelectedDefaultSearchProvider(NULL);
539 model()->Remove(local_turl); 543 model()->Remove(local_turl);
540 } 544 }
541 } 545 }
542 546
543 TEST_F(TemplateURLServiceSyncTest, ResolveSyncKeywordConflict) { 547 TEST_F(TemplateURLServiceSyncTest, ResolveSyncKeywordConflict) {
544 // This tests cases where neither the sync nor the local TemplateURL are 548 // This tests cases where neither the sync nor the local TemplateURL are
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 EXPECT_EQ(0, merge_result.num_items_deleted()); 851 EXPECT_EQ(0, merge_result.num_items_deleted());
848 EXPECT_EQ(3, merge_result.num_items_before_association()); 852 EXPECT_EQ(3, merge_result.num_items_before_association());
849 EXPECT_EQ(4, merge_result.num_items_after_association()); 853 EXPECT_EQ(4, merge_result.num_items_after_association());
850 } 854 }
851 855
852 TEST_F(TemplateURLServiceSyncTest, MergeAddFromNewerSyncData) { 856 TEST_F(TemplateURLServiceSyncTest, MergeAddFromNewerSyncData) {
853 // GUIDs all differ, so Sync may overtake some entries, but the timestamps 857 // GUIDs all differ, so Sync may overtake some entries, but the timestamps
854 // from Sync are newer. Set up the local data so that one is a dupe, one has a 858 // from Sync are newer. Set up the local data so that one is a dupe, one has a
855 // conflicting keyword, and the last has no conflicts (a clean ADD). 859 // conflicting keyword, and the last has no conflicts (a clean ADD).
856 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key1"), "http://key1.com", 860 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key1"), "http://key1.com",
857 "aaa", 10)); // dupe 861 "aaa", 10, false, false, 111)); // dupe
858 862
859 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key2"), 863 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key2"),
860 "http://expected.com", "bbb", 10)); // keyword conflict 864 "http://expected.com", "bbb", 10, false,
865 false, 112)); // keyword conflict
861 866
862 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("unique"), 867 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("unique"),
863 "http://unique.com", "ccc", 10)); // add 868 "http://unique.com", "ccc", 10, false,
869 false, 113)); // add
864 870
865 syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing( 871 syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing(
866 syncer::SEARCH_ENGINES, 872 syncer::SEARCH_ENGINES,
867 CreateInitialSyncData(), PassProcessor(), 873 CreateInitialSyncData(), PassProcessor(),
868 CreateAndPassSyncErrorFactory()); 874 CreateAndPassSyncErrorFactory());
869 875
870 // The dupe and keyword conflict results in merges. The unique keyword be 876 // The dupe and keyword conflict results in merges. The unique keyword be
871 // added to the model. 877 // added to the model.
872 EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); 878 EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size());
873 879
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 TEST_F(TemplateURLServiceSyncTest, AutogeneratedKeywordMigrated) { 1141 TEST_F(TemplateURLServiceSyncTest, AutogeneratedKeywordMigrated) {
1136 // Create a couple of sync entries with autogenerated keywords. 1142 // Create a couple of sync entries with autogenerated keywords.
1137 syncer::SyncDataList initial_data; 1143 syncer::SyncDataList initial_data;
1138 std::unique_ptr<TemplateURL> turl( 1144 std::unique_ptr<TemplateURL> turl(
1139 CreateTestTemplateURL(ASCIIToUTF16("key1"), "http://key1.com", "key1")); 1145 CreateTestTemplateURL(ASCIIToUTF16("key1"), "http://key1.com", "key1"));
1140 initial_data.push_back( 1146 initial_data.push_back(
1141 CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid())); 1147 CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid()));
1142 turl.reset(CreateTestTemplateURL(ASCIIToUTF16("key2"), 1148 turl.reset(CreateTestTemplateURL(ASCIIToUTF16("key2"),
1143 "{google:baseURL}search?q={searchTerms}", "key2")); 1149 "{google:baseURL}search?q={searchTerms}", "key2"));
1144 initial_data.push_back( 1150 initial_data.push_back(
1145 CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid())); 1151 CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid(), 99));
1146 1152
1147 // Now try to sync the data locally. 1153 // Now try to sync the data locally.
1148 model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, 1154 model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data,
1149 PassProcessor(), CreateAndPassSyncErrorFactory()); 1155 PassProcessor(), CreateAndPassSyncErrorFactory());
1150 1156
1151 // Both entries should have been added, with explicit keywords. 1157 // Both entries should have been added, with explicit keywords.
1152 TemplateURL* key1 = model()->GetTemplateURLForHost("key1.com"); 1158 TemplateURL* key1 = model()->GetTemplateURLForHost("key1.com");
1153 ASSERT_FALSE(key1 == NULL); 1159 ASSERT_FALSE(key1 == NULL);
1154 EXPECT_EQ(ASCIIToUTF16("key1.com"), key1->keyword()); 1160 EXPECT_EQ(ASCIIToUTF16("key1.com"), key1->keyword());
1155 GURL google_url(model()->search_terms_data().GoogleBaseURLValue()); 1161 GURL google_url(model()->search_terms_data().GoogleBaseURLValue());
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 syncer::SEARCH_ENGINES, list, PassProcessor(), 2220 syncer::SEARCH_ENGINES, list, PassProcessor(),
2215 CreateAndPassSyncErrorFactory()); 2221 CreateAndPassSyncErrorFactory());
2216 2222
2217 const TemplateURL* result_turl = model()->GetTemplateURLForGUID("default"); 2223 const TemplateURL* result_turl = model()->GetTemplateURLForGUID("default");
2218 EXPECT_TRUE(result_turl); 2224 EXPECT_TRUE(result_turl);
2219 EXPECT_EQ(ASCIIToUTF16("new_kw"), result_turl->keyword()); 2225 EXPECT_EQ(ASCIIToUTF16("new_kw"), result_turl->keyword());
2220 EXPECT_EQ(ASCIIToUTF16("my name"), result_turl->short_name()); 2226 EXPECT_EQ(ASCIIToUTF16("my name"), result_turl->short_name());
2221 EXPECT_EQ(default_turl->url(), result_turl->url()); 2227 EXPECT_EQ(default_turl->url(), result_turl->url());
2222 } 2228 }
2223 2229
2230 TEST_F(TemplateURLServiceSyncTest, MergeConflictingPrepopulatedEngine) {
2231 std::unique_ptr<TemplateURLData> default_turl(
2232 TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(nullptr));
2233
2234 TemplateURLData data(*default_turl);
2235 data.SetKeyword(ASCIIToUTF16("old_kw"));
2236 data.SetShortName(ASCIIToUTF16("my name"));
2237 data.SetURL("http://wrong.url.com?q={searchTerms}");
2238 data.safe_for_autoreplace = true;
2239 data.date_created = Time::FromTimeT(50);
2240 data.last_modified = Time::FromTimeT(50);
2241 data.prepopulate_id = 1;
2242 data.sync_guid = "default";
2243 model()->Add(new TemplateURL(data));
2244
2245 TemplateURLData new_data(*default_turl);
2246 new_data.SetKeyword(ASCIIToUTF16("new_kw"));
2247 new_data.SetShortName(ASCIIToUTF16("my name"));
2248 new_data.SetURL("http://wrong.url.com?q={searchTerms}");
2249 new_data.safe_for_autoreplace = false;
2250 new_data.date_created = Time::FromTimeT(100);
2251 new_data.last_modified = Time::FromTimeT(100);
2252 new_data.prepopulate_id = 1;
2253 new_data.sync_guid = "different_guid";
2254
2255 // Test that a remote TemplateURL can override a local TemplateURL not yet
2256 // known to sync.
2257 std::unique_ptr<TemplateURL> sync_turl =
2258 base::MakeUnique<TemplateURL>(new_data);
2259 syncer::SyncDataList list;
2260 list.push_back(TemplateURLService::CreateSyncDataFromTemplateURL(*sync_turl));
2261 syncer::SyncMergeResult merge_result = model()->MergeDataAndStartSyncing(
2262 syncer::SEARCH_ENGINES, list, PassProcessor(),
2263 CreateAndPassSyncErrorFactory());
2264
2265 TemplateURL* result_turl = model()->GetTemplateURLForGUID("different_guid");
2266 EXPECT_TRUE(result_turl);
2267 EXPECT_EQ(ASCIIToUTF16("new_kw"), result_turl->keyword());
2268 EXPECT_EQ(ASCIIToUTF16("my name"), result_turl->short_name());
2269 EXPECT_EQ(default_turl->url(), result_turl->url());
2270
2271 // Reset the state of the service.
2272 model()->Remove(result_turl);
2273 model()->StopSyncing(syncer::SEARCH_ENGINES);
2274 sync_processor_wrapper_.reset(
2275 new syncer::SyncChangeProcessorWrapperForTest(sync_processor_.get()));
2276
2277 // Now test that a remote TemplateURL can override the attributes of the local
2278 // default search provider.
2279 TemplateURL* existing_default = new TemplateURL(data);
2280 model()->Add(existing_default);
2281 model()->SetUserSelectedDefaultSearchProvider(existing_default);
2282
2283 merge_result = model()->MergeDataAndStartSyncing(
2284 syncer::SEARCH_ENGINES, list, PassProcessor(),
2285 CreateAndPassSyncErrorFactory());
2286
2287 result_turl = model()->GetDefaultSearchProvider();
2288 EXPECT_TRUE(result_turl);
2289 EXPECT_EQ(ASCIIToUTF16("new_kw"), result_turl->keyword());
2290 EXPECT_EQ(ASCIIToUTF16("my name"), result_turl->short_name());
2291 EXPECT_EQ(default_turl->url(), result_turl->url());
2292 }
2293
2224 TEST_F(TemplateURLServiceSyncTest, MergeNonEditedPrepopulatedEngine) { 2294 TEST_F(TemplateURLServiceSyncTest, MergeNonEditedPrepopulatedEngine) {
2225 std::unique_ptr<TemplateURLData> default_turl( 2295 std::unique_ptr<TemplateURLData> default_turl(
2226 TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(NULL)); 2296 TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(NULL));
2227 2297
2228 TemplateURLData data(*default_turl); 2298 TemplateURLData data(*default_turl);
2229 data.safe_for_autoreplace = true; // Can be replaced with built-in values. 2299 data.safe_for_autoreplace = true; // Can be replaced with built-in values.
2230 data.SetKeyword(ASCIIToUTF16("new_kw")); 2300 data.SetKeyword(ASCIIToUTF16("new_kw"));
2231 data.SetShortName(ASCIIToUTF16("my name")); 2301 data.SetShortName(ASCIIToUTF16("my name"));
2232 data.SetURL("http://wrong.url.com?q={searchTerms}"); 2302 data.SetURL("http://wrong.url.com?q={searchTerms}");
2233 data.date_created = Time::FromTimeT(50); 2303 data.date_created = Time::FromTimeT(50);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 2345
2276 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { 2346 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) {
2277 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), 2347 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"),
2278 "http://key1.com")); 2348 "http://key1.com"));
2279 syncer::SyncDataList initial_data = CreateInitialSyncData(); 2349 syncer::SyncDataList initial_data = CreateInitialSyncData();
2280 2350
2281 model()->MergeDataAndStartSyncing( 2351 model()->MergeDataAndStartSyncing(
2282 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), 2352 syncer::SEARCH_ENGINES, initial_data, PassProcessor(),
2283 CreateAndPassSyncErrorFactory()); 2353 CreateAndPassSyncErrorFactory());
2284 } 2354 }
OLDNEW
« no previous file with comments | « no previous file | components/search_engines/template_url_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698