Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/sync/profile_sync_service_autofill_unittest.cc

Issue 6811003: [Sync] Make generic non-frontend thread datatype controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix autofill Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 ASSERT_TRUE(task.success()); 656 ASSERT_TRUE(task.success());
657 std::vector<AutofillEntry> sync_entries; 657 std::vector<AutofillEntry> sync_entries;
658 std::vector<AutofillProfile> sync_profiles; 658 std::vector<AutofillProfile> sync_profiles;
659 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 659 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
660 ASSERT_EQ(1U, entries.size()); 660 ASSERT_EQ(1U, entries.size());
661 EXPECT_TRUE(entries[0] == sync_entries[0]); 661 EXPECT_TRUE(entries[0] == sync_entries[0]);
662 EXPECT_EQ(0U, sync_profiles.size()); 662 EXPECT_EQ(0U, sync_profiles.size());
663 } 663 }
664 664
665 TEST_F(ProfileSyncServiceAutofillTest, HasProfileEmptySync) { 665 TEST_F(ProfileSyncServiceAutofillTest, HasProfileEmptySync) {
666
667 std::vector<AutofillProfile*> profiles; 666 std::vector<AutofillProfile*> profiles;
668 std::vector<AutofillProfile> expected_profiles; 667 std::vector<AutofillProfile> expected_profiles;
669 // Owned by GetAutofillProfiles caller. 668 // Owned by GetAutofillProfiles caller.
670 AutofillProfile* profile0 = new AutofillProfile; 669 AutofillProfile* profile0 = new AutofillProfile;
671 autofill_test::SetProfileInfoWithGuid(profile0, 670 autofill_test::SetProfileInfoWithGuid(profile0,
672 "54B3F9AA-335E-4F71-A27D-719C41564230", "Billing", 671 "54B3F9AA-335E-4F71-A27D-719C41564230", "Billing",
673 "Mitchell", "Morrison", 672 "Mitchell", "Morrison",
674 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", 673 "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA",
675 "91601", "US", "12345678910", "01987654321"); 674 "91601", "US", "12345678910", "01987654321");
676 profiles.push_back(profile0); 675 profiles.push_back(profile0);
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 std::vector<AutofillEntry> sync_entries; 1082 std::vector<AutofillEntry> sync_entries;
1084 std::vector<AutofillProfile> sync_profiles; 1083 std::vector<AutofillProfile> sync_profiles;
1085 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1084 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1086 EXPECT_EQ(3U, sync_entries.size()); 1085 EXPECT_EQ(3U, sync_entries.size());
1087 EXPECT_EQ(0U, sync_profiles.size()); 1086 EXPECT_EQ(0U, sync_profiles.size());
1088 for (size_t i = 0; i < sync_entries.size(); i++) { 1087 for (size_t i = 0; i < sync_entries.size(); i++) {
1089 VLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1088 VLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1090 << ", " << sync_entries[i].key().value(); 1089 << ", " << sync_entries[i].key().value();
1091 } 1090 }
1092 } 1091 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698