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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 (*wait_for_start_)->Signal(); | 734 (*wait_for_start_)->Signal(); |
735 | 735 |
736 // Create write transaction. | 736 // Create write transaction. |
737 WriteTransactionTest trans(FROM_HERE, UNITTEST, directory, | 737 WriteTransactionTest trans(FROM_HERE, UNITTEST, directory, |
738 wait_for_syncapi_); | 738 wait_for_syncapi_); |
739 | 739 |
740 // Create actual entry based on autofill protobuf information. | 740 // Create actual entry based on autofill protobuf information. |
741 // Simulates effects of UpdateLocalDataFromServerData | 741 // Simulates effects of UpdateLocalDataFromServerData |
742 MutableEntry parent(&trans, GET_BY_SERVER_TAG, | 742 MutableEntry parent(&trans, GET_BY_SERVER_TAG, |
743 syncer::ModelTypeToRootTag(syncer::AUTOFILL)); | 743 syncer::ModelTypeToRootTag(syncer::AUTOFILL)); |
744 MutableEntry item(&trans, CREATE, parent.Get(syncer::syncable::ID), tag); | 744 MutableEntry item(&trans, CREATE, syncer::AUTOFILL, |
| 745 parent.Get(syncer::syncable::ID), tag); |
745 ASSERT_TRUE(item.good()); | 746 ASSERT_TRUE(item.good()); |
746 item.Put(SPECIFICS, entity_specifics); | 747 item.Put(SPECIFICS, entity_specifics); |
747 item.Put(SERVER_SPECIFICS, entity_specifics); | 748 item.Put(SERVER_SPECIFICS, entity_specifics); |
748 item.Put(BASE_VERSION, 1); | 749 item.Put(BASE_VERSION, 1); |
749 syncer::syncable::Id server_item_id = | 750 syncer::syncable::Id server_item_id = |
750 service_->id_factory()->NewServerId(); | 751 service_->id_factory()->NewServerId(); |
751 item.Put(syncer::syncable::ID, server_item_id); | 752 item.Put(syncer::syncable::ID, server_item_id); |
752 syncer::syncable::Id new_predecessor; | 753 syncer::syncable::Id new_predecessor; |
753 ASSERT_TRUE(item.PutPredecessor(new_predecessor)); | 754 ASSERT_TRUE(item.PutPredecessor(new_predecessor)); |
754 } | 755 } |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 std::vector<AutofillEntry> sync_entries; | 1297 std::vector<AutofillEntry> sync_entries; |
1297 std::vector<AutofillProfile> sync_profiles; | 1298 std::vector<AutofillProfile> sync_profiles; |
1298 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1299 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1299 EXPECT_EQ(3U, sync_entries.size()); | 1300 EXPECT_EQ(3U, sync_entries.size()); |
1300 EXPECT_EQ(0U, sync_profiles.size()); | 1301 EXPECT_EQ(0U, sync_profiles.size()); |
1301 for (size_t i = 0; i < sync_entries.size(); i++) { | 1302 for (size_t i = 0; i < sync_entries.size(); i++) { |
1302 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1303 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1303 << ", " << sync_entries[i].key().value(); | 1304 << ", " << sync_entries[i].key().value(); |
1304 } | 1305 } |
1305 } | 1306 } |
OLD | NEW |