| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "components/autofill/core/browser/webdata/autofill_change.h" | 44 #include "components/autofill/core/browser/webdata/autofill_change.h" |
| 45 #include "components/autofill/core/browser/webdata/autofill_entry.h" | 45 #include "components/autofill/core/browser/webdata/autofill_entry.h" |
| 46 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 46 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 47 #include "components/autofill/core/browser/webdata/autofill_table.h" | 47 #include "components/autofill/core/browser/webdata/autofill_table.h" |
| 48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 48 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 49 #include "components/sync_driver/data_type_controller.h" | 49 #include "components/sync_driver/data_type_controller.h" |
| 50 #include "components/webdata/common/web_data_service_test_util.h" | 50 #include "components/webdata/common/web_data_service_test_util.h" |
| 51 #include "components/webdata/common/web_database.h" | 51 #include "components/webdata/common/web_database.h" |
| 52 #include "content/public/test/test_browser_thread.h" | 52 #include "content/public/test/test_browser_thread.h" |
| 53 #include "google_apis/gaia/gaia_constants.h" | 53 #include "google_apis/gaia/gaia_constants.h" |
| 54 #include "sync/api/attachments/fake_attachment_service.h" |
| 54 #include "sync/internal_api/public/base/model_type.h" | 55 #include "sync/internal_api/public/base/model_type.h" |
| 55 #include "sync/internal_api/public/data_type_debug_info_listener.h" | 56 #include "sync/internal_api/public/data_type_debug_info_listener.h" |
| 56 #include "sync/internal_api/public/read_node.h" | 57 #include "sync/internal_api/public/read_node.h" |
| 57 #include "sync/internal_api/public/read_transaction.h" | 58 #include "sync/internal_api/public/read_transaction.h" |
| 58 #include "sync/internal_api/public/write_node.h" | 59 #include "sync/internal_api/public/write_node.h" |
| 59 #include "sync/internal_api/public/write_transaction.h" | 60 #include "sync/internal_api/public/write_transaction.h" |
| 60 #include "sync/protocol/autofill_specifics.pb.h" | 61 #include "sync/protocol/autofill_specifics.pb.h" |
| 61 #include "sync/syncable/mutable_entry.h" | 62 #include "sync/syncable/mutable_entry.h" |
| 62 #include "sync/syncable/syncable_write_transaction.h" | 63 #include "sync/syncable/syncable_write_transaction.h" |
| 63 #include "sync/test/engine/test_id_factory.h" | 64 #include "sync/test/engine/test_id_factory.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 arg4, | 362 arg4, |
| 362 arg5); | 363 arg5); |
| 363 } | 364 } |
| 364 | 365 |
| 365 ACTION(MakeGenericChangeProcessor) { | 366 ACTION(MakeGenericChangeProcessor) { |
| 366 syncer::UserShare* user_share = arg0->GetUserShare(); | 367 syncer::UserShare* user_share = arg0->GetUserShare(); |
| 367 return new GenericChangeProcessor( | 368 return new GenericChangeProcessor( |
| 368 arg1, | 369 arg1, |
| 369 arg2, | 370 arg2, |
| 370 arg3, | 371 arg3, |
| 371 user_share); | 372 user_share, |
| 373 syncer::FakeAttachmentService::CreateForTest()); |
| 372 } | 374 } |
| 373 | 375 |
| 374 ACTION(MakeSharedChangeProcessor) { | 376 ACTION(MakeSharedChangeProcessor) { |
| 375 return new SharedChangeProcessor(); | 377 return new SharedChangeProcessor(); |
| 376 } | 378 } |
| 377 | 379 |
| 378 ACTION_P(MakeAutofillProfileSyncComponents, wds) { | 380 ACTION_P(MakeAutofillProfileSyncComponents, wds) { |
| 379 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 381 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 380 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) | 382 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) |
| 381 return base::WeakPtr<syncer::SyncableService>(); | 383 return base::WeakPtr<syncer::SyncableService>(); |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 std::vector<AutofillEntry> sync_entries; | 1393 std::vector<AutofillEntry> sync_entries; |
| 1392 std::vector<AutofillProfile> sync_profiles; | 1394 std::vector<AutofillProfile> sync_profiles; |
| 1393 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1395 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
| 1394 EXPECT_EQ(3U, sync_entries.size()); | 1396 EXPECT_EQ(3U, sync_entries.size()); |
| 1395 EXPECT_EQ(0U, sync_profiles.size()); | 1397 EXPECT_EQ(0U, sync_profiles.size()); |
| 1396 for (size_t i = 0; i < sync_entries.size(); i++) { | 1398 for (size_t i = 0; i < sync_entries.size(); i++) { |
| 1397 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1399 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
| 1398 << ", " << sync_entries[i].key().value(); | 1400 << ", " << sync_entries[i].key().value(); |
| 1399 } | 1401 } |
| 1400 } | 1402 } |
| OLD | NEW |