| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "testing/gtest/include/gtest/gtest.h" | |
| 14 | |
| 15 #include "base/bind.h" | 13 #include "base/bind.h" |
| 16 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 17 #include "base/callback.h" | 15 #include "base/callback.h" |
| 18 #include "base/location.h" | 16 #include "base/location.h" |
| 19 #include "base/macros.h" | 17 #include "base/macros.h" |
| 20 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 21 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 22 #include "base/run_loop.h" | 20 #include "base/run_loop.h" |
| 23 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/synchronization/waitable_event.h" | 23 #include "base/synchronization/waitable_event.h" |
| 26 #include "base/thread_task_runner_handle.h" | 24 #include "base/thread_task_runner_handle.h" |
| 27 #include "base/threading/thread.h" | 25 #include "base/threading/thread.h" |
| 28 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 29 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | |
| 30 #include "chrome/browser/sync/test_profile_sync_service.h" | |
| 31 #include "components/autofill/core/browser/autofill_test_utils.h" | 27 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 32 #include "components/autofill/core/browser/country_names.h" | 28 #include "components/autofill/core/browser/country_names.h" |
| 33 #include "components/autofill/core/browser/personal_data_manager.h" | 29 #include "components/autofill/core/browser/personal_data_manager.h" |
| 34 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" | 30 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" |
| 35 #include "components/autofill/core/browser/webdata/autofill_change.h" | 31 #include "components/autofill/core/browser/webdata/autofill_change.h" |
| 36 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" | 32 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" |
| 37 #include "components/autofill/core/browser/webdata/autofill_entry.h" | 33 #include "components/autofill/core/browser/webdata/autofill_entry.h" |
| 38 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" | 34 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" |
| 39 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 35 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 40 #include "components/autofill/core/browser/webdata/autofill_table.h" | 36 #include "components/autofill/core/browser/webdata/autofill_table.h" |
| 41 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 37 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 42 #include "components/autofill/core/common/autofill_pref_names.h" | 38 #include "components/autofill/core/common/autofill_pref_names.h" |
| 39 #include "components/browser_sync/browser/abstract_profile_sync_service_test.h" |
| 43 #include "components/browser_sync/browser/profile_sync_service.h" | 40 #include "components/browser_sync/browser/profile_sync_service.h" |
| 41 #include "components/browser_sync/browser/test_profile_sync_service.h" |
| 44 #include "components/sync_driver/data_type_controller.h" | 42 #include "components/sync_driver/data_type_controller.h" |
| 45 #include "components/sync_driver/data_type_manager_impl.h" | 43 #include "components/sync_driver/data_type_manager_impl.h" |
| 46 #include "components/sync_driver/sync_api_component_factory_mock.h" | 44 #include "components/sync_driver/sync_api_component_factory_mock.h" |
| 47 #include "components/syncable_prefs/pref_service_syncable.h" | 45 #include "components/syncable_prefs/pref_service_syncable.h" |
| 48 #include "components/webdata/common/web_database.h" | 46 #include "components/webdata/common/web_database.h" |
| 49 #include "components/webdata_services/web_data_service_test_util.h" | 47 #include "components/webdata_services/web_data_service_test_util.h" |
| 50 #include "sync/internal_api/public/base/model_type.h" | 48 #include "sync/internal_api/public/base/model_type.h" |
| 51 #include "sync/internal_api/public/data_type_debug_info_listener.h" | 49 #include "sync/internal_api/public/data_type_debug_info_listener.h" |
| 52 #include "sync/internal_api/public/read_node.h" | 50 #include "sync/internal_api/public/read_node.h" |
| 53 #include "sync/internal_api/public/read_transaction.h" | 51 #include "sync/internal_api/public/read_transaction.h" |
| 54 #include "sync/internal_api/public/write_node.h" | 52 #include "sync/internal_api/public/write_node.h" |
| 55 #include "sync/internal_api/public/write_transaction.h" | 53 #include "sync/internal_api/public/write_transaction.h" |
| 56 #include "sync/protocol/autofill_specifics.pb.h" | 54 #include "sync/protocol/autofill_specifics.pb.h" |
| 57 #include "sync/syncable/mutable_entry.h" | 55 #include "sync/syncable/mutable_entry.h" |
| 58 #include "sync/syncable/syncable_write_transaction.h" | 56 #include "sync/syncable/syncable_write_transaction.h" |
| 59 #include "testing/gmock/include/gmock/gmock.h" | 57 #include "testing/gmock/include/gmock/gmock.h" |
| 58 #include "testing/gtest/include/gtest/gtest.h" |
| 60 | 59 |
| 61 using autofill::AutocompleteSyncableService; | 60 using autofill::AutocompleteSyncableService; |
| 62 using autofill::AutofillChange; | 61 using autofill::AutofillChange; |
| 63 using autofill::AutofillChangeList; | 62 using autofill::AutofillChangeList; |
| 64 using autofill::AutofillEntry; | 63 using autofill::AutofillEntry; |
| 65 using autofill::AutofillKey; | 64 using autofill::AutofillKey; |
| 66 using autofill::AutofillProfile; | 65 using autofill::AutofillProfile; |
| 67 using autofill::AutofillProfileChange; | 66 using autofill::AutofillProfileChange; |
| 68 using autofill::AutofillProfileSyncableService; | 67 using autofill::AutofillProfileSyncableService; |
| 69 using autofill::AutofillTable; | 68 using autofill::AutofillTable; |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 std::vector<AutofillEntry> sync_entries; | 1241 std::vector<AutofillEntry> sync_entries; |
| 1243 std::vector<AutofillProfile> sync_profiles; | 1242 std::vector<AutofillProfile> sync_profiles; |
| 1244 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1243 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
| 1245 EXPECT_EQ(3U, sync_entries.size()); | 1244 EXPECT_EQ(3U, sync_entries.size()); |
| 1246 EXPECT_EQ(0U, sync_profiles.size()); | 1245 EXPECT_EQ(0U, sync_profiles.size()); |
| 1247 for (size_t i = 0; i < sync_entries.size(); i++) { | 1246 for (size_t i = 0; i < sync_entries.size(); i++) { |
| 1248 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1247 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
| 1249 << ", " << sync_entries[i].key().value(); | 1248 << ", " << sync_entries[i].key().value(); |
| 1250 } | 1249 } |
| 1251 } | 1250 } |
| OLD | NEW |