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

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

Issue 12543034: Move creation of the various WebDatabaseTable types out of WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows release builds (COMDAT folding combined static functions being used for keys. Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/autofill_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 using testing::Return; 88 using testing::Return;
89 89
90 namespace syncable { 90 namespace syncable {
91 class Id; 91 class Id;
92 } 92 }
93 93
94 class HistoryService; 94 class HistoryService;
95 95
96 class AutofillTableMock : public AutofillTable { 96 class AutofillTableMock : public AutofillTable {
97 public: 97 public:
98 AutofillTableMock() : AutofillTable(NULL, NULL) {} 98 AutofillTableMock() : AutofillTable() {}
99 MOCK_METHOD2(RemoveFormElement, 99 MOCK_METHOD2(RemoveFormElement,
100 bool(const string16& name, const string16& value)); // NOLINT 100 bool(const string16& name, const string16& value)); // NOLINT
101 MOCK_METHOD1(GetAllAutofillEntries, 101 MOCK_METHOD1(GetAllAutofillEntries,
102 bool(std::vector<AutofillEntry>* entries)); // NOLINT 102 bool(std::vector<AutofillEntry>* entries)); // NOLINT
103 MOCK_METHOD3(GetAutofillTimestamps, 103 MOCK_METHOD3(GetAutofillTimestamps,
104 bool(const string16& name, // NOLINT 104 bool(const string16& name, // NOLINT
105 const string16& value, 105 const string16& value,
106 std::vector<base::Time>* timestamps)); 106 std::vector<base::Time>* timestamps));
107 MOCK_METHOD1(UpdateAutofillEntries, 107 MOCK_METHOD1(UpdateAutofillEntries,
108 bool(const std::vector<AutofillEntry>&)); // NOLINT 108 bool(const std::vector<AutofillEntry>&)); // NOLINT
109 MOCK_METHOD1(GetAutofillProfiles, 109 MOCK_METHOD1(GetAutofillProfiles,
110 bool(std::vector<AutofillProfile*>*)); // NOLINT 110 bool(std::vector<AutofillProfile*>*)); // NOLINT
111 MOCK_METHOD1(UpdateAutofillProfileMulti, 111 MOCK_METHOD1(UpdateAutofillProfileMulti,
112 bool(const AutofillProfile&)); // NOLINT 112 bool(const AutofillProfile&)); // NOLINT
113 MOCK_METHOD1(AddAutofillProfile, 113 MOCK_METHOD1(AddAutofillProfile,
114 bool(const AutofillProfile&)); // NOLINT 114 bool(const AutofillProfile&)); // NOLINT
115 MOCK_METHOD1(RemoveAutofillProfile, 115 MOCK_METHOD1(RemoveAutofillProfile,
116 bool(const std::string&)); // NOLINT 116 bool(const std::string&)); // NOLINT
117 }; 117 };
118 118
119 MATCHER_P(MatchProfiles, profile, "") { 119 MATCHER_P(MatchProfiles, profile, "") {
120 return (profile.Compare(arg) == 0); 120 return (profile.Compare(arg) == 0);
121 } 121 }
122 122
123 class WebDatabaseFake : public WebDatabase { 123 class WebDatabaseFake : public WebDatabase {
124 public: 124 public:
125 explicit WebDatabaseFake(AutofillTable* autofill_table) 125 explicit WebDatabaseFake(AutofillTable* autofill_table) {
126 : autofill_table_(autofill_table) {} 126 AddTable(autofill_table);
127
128 virtual AutofillTable* GetAutofillTable() OVERRIDE {
129 return autofill_table_;
130 } 127 }
131
132 private:
133 AutofillTable* autofill_table_;
134 }; 128 };
135 129
136 class ProfileSyncServiceAutofillTest; 130 class ProfileSyncServiceAutofillTest;
137 131
138 template<class AutofillProfile> 132 template<class AutofillProfile>
139 syncer::ModelType GetModelType() { 133 syncer::ModelType GetModelType() {
140 return syncer::UNSPECIFIED; 134 return syncer::UNSPECIFIED;
141 } 135 }
142 136
143 template<> 137 template<>
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 std::vector<AutofillEntry> sync_entries; 1313 std::vector<AutofillEntry> sync_entries;
1320 std::vector<AutofillProfile> sync_profiles; 1314 std::vector<AutofillProfile> sync_profiles;
1321 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1315 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1322 EXPECT_EQ(3U, sync_entries.size()); 1316 EXPECT_EQ(3U, sync_entries.size());
1323 EXPECT_EQ(0U, sync_profiles.size()); 1317 EXPECT_EQ(0U, sync_profiles.size());
1324 for (size_t i = 0; i < sync_entries.size(); i++) { 1318 for (size_t i = 0; i < sync_entries.size(); i++) {
1325 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1319 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1326 << ", " << sync_entries[i].key().value(); 1320 << ", " << sync_entries[i].key().value();
1327 } 1321 }
1328 } 1322 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/autofill_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698