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 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 EXPECT_EQ(0, merge_result.num_items_modified()); | 1839 EXPECT_EQ(0, merge_result.num_items_modified()); |
1840 EXPECT_EQ(0, merge_result.num_items_deleted()); | 1840 EXPECT_EQ(0, merge_result.num_items_deleted()); |
1841 EXPECT_EQ(1, merge_result.num_items_before_association()); | 1841 EXPECT_EQ(1, merge_result.num_items_before_association()); |
1842 EXPECT_EQ(2, merge_result.num_items_after_association()); | 1842 EXPECT_EQ(2, merge_result.num_items_after_association()); |
1843 } | 1843 } |
1844 | 1844 |
1845 TEST_F(TemplateURLServiceSyncTest, PreSyncUpdates) { | 1845 TEST_F(TemplateURLServiceSyncTest, PreSyncUpdates) { |
1846 const char* kNewKeyword = "somethingnew"; | 1846 const char* kNewKeyword = "somethingnew"; |
1847 // Fetch the prepopulate search engines so we know what they are. | 1847 // Fetch the prepopulate search engines so we know what they are. |
1848 size_t default_search_provider_index = 0; | 1848 size_t default_search_provider_index = 0; |
1849 ScopedVector<TemplateURLData> prepop_turls = | 1849 std::vector<std::unique_ptr<TemplateURLData>> prepop_turls = |
1850 TemplateURLPrepopulateData::GetPrepopulatedEngines( | 1850 TemplateURLPrepopulateData::GetPrepopulatedEngines( |
1851 profile_a()->GetTestingPrefService(), &default_search_provider_index); | 1851 profile_a()->GetTestingPrefService(), &default_search_provider_index); |
1852 | 1852 |
1853 // We have to prematurely exit this test if for some reason this machine does | 1853 // We have to prematurely exit this test if for some reason this machine does |
1854 // not have any prepopulate TemplateURLs. | 1854 // not have any prepopulate TemplateURLs. |
1855 ASSERT_FALSE(prepop_turls.empty()); | 1855 ASSERT_FALSE(prepop_turls.empty()); |
1856 | 1856 |
1857 // Create a copy of the first TemplateURL with a really old timestamp and a | 1857 // Create a copy of the first TemplateURL with a really old timestamp and a |
1858 // new keyword. Add it to the model. | 1858 // new keyword. Add it to the model. |
1859 TemplateURLData data_copy(*prepop_turls[0]); | 1859 TemplateURLData data_copy(*prepop_turls[0]); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 | 2330 |
2331 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { | 2331 TEST_F(TemplateURLServiceSyncTest, NonAsciiKeywordDoesNotCrash) { |
2332 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), | 2332 model()->Add(CreateTestTemplateURL(UTF8ToUTF16("\xf0\xaf\xa6\x8d"), |
2333 "http://key1.com")); | 2333 "http://key1.com")); |
2334 syncer::SyncDataList initial_data = CreateInitialSyncData(); | 2334 syncer::SyncDataList initial_data = CreateInitialSyncData(); |
2335 | 2335 |
2336 model()->MergeDataAndStartSyncing( | 2336 model()->MergeDataAndStartSyncing( |
2337 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), | 2337 syncer::SEARCH_ENGINES, initial_data, PassProcessor(), |
2338 CreateAndPassSyncErrorFactory()); | 2338 CreateAndPassSyncErrorFactory()); |
2339 } | 2339 } |
OLD | NEW |