| 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 <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 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2265 const char kNewGUID[] = "newdefault"; | 2265 const char kNewGUID[] = "newdefault"; |
| 2266 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), | 2266 model()->Add(CreateTestTemplateURL(ASCIIToUTF16("what"), |
| 2267 "http://thewhat.com/{searchTerms}", | 2267 "http://thewhat.com/{searchTerms}", |
| 2268 kNewGUID)); | 2268 kNewGUID)); |
| 2269 model()->SetUserSelectedDefaultSearchProvider( | 2269 model()->SetUserSelectedDefaultSearchProvider( |
| 2270 model()->GetTemplateURLForGUID(kNewGUID)); | 2270 model()->GetTemplateURLForGUID(kNewGUID)); |
| 2271 | 2271 |
| 2272 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( | 2272 EXPECT_EQ(kNewGUID, profile_a()->GetTestingPrefService()->GetString( |
| 2273 prefs::kSyncedDefaultSearchProviderGUID)); | 2273 prefs::kSyncedDefaultSearchProviderGUID)); |
| 2274 } | 2274 } |
| 2275 |
| 2276 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { |
| 2277 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), |
| 2278 "http://key1.com")); |
| 2279 syncer::SyncDataList initial_data = CreateInitialSyncData(); |
| 2280 |
| 2281 model()->MergeDataAndStartSyncing( |
| 2282 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), |
| 2283 CreateAndPassSyncErrorFactory()); |
| 2284 } |
| OLD | NEW |