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

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

Issue 14679005: Create an AutofillBackend interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix WIN Created 7 years, 7 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 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 private: 186 private:
187 virtual ~TokenWebDataServiceFake() {} 187 virtual ~TokenWebDataServiceFake() {}
188 188
189 DISALLOW_COPY_AND_ASSIGN(TokenWebDataServiceFake); 189 DISALLOW_COPY_AND_ASSIGN(TokenWebDataServiceFake);
190 }; 190 };
191 191
192 class WebDataServiceFake : public AutofillWebDataService { 192 class WebDataServiceFake : public AutofillWebDataService {
193 public: 193 public:
194 WebDataServiceFake() 194 WebDataServiceFake()
195 : AutofillWebDataService(NULL, 195 : AutofillWebDataService(),
196 WebDataServiceBase::ProfileErrorCallback()),
197 web_database_(NULL), 196 web_database_(NULL),
198 autocomplete_syncable_service_(NULL), 197 autocomplete_syncable_service_(NULL),
199 autofill_profile_syncable_service_(NULL), 198 autofill_profile_syncable_service_(NULL),
200 syncable_service_created_or_destroyed_(false, false) { 199 syncable_service_created_or_destroyed_(false, false) {
201 } 200 }
202 201
203 void SetDatabase(WebDatabase* web_database) { 202 void SetDatabase(WebDatabase* web_database) {
204 web_database_ = web_database; 203 web_database_ = web_database;
205 } 204 }
206 205
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 user_share); 325 user_share);
327 } 326 }
328 327
329 ACTION(MakeSharedChangeProcessor) { 328 ACTION(MakeSharedChangeProcessor) {
330 return new SharedChangeProcessor(); 329 return new SharedChangeProcessor();
331 } 330 }
332 331
333 ACTION_P(MakeAutofillProfileSyncComponents, wds) { 332 ACTION_P(MakeAutofillProfileSyncComponents, wds) {
334 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); 333 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
335 if (!BrowserThread::CurrentlyOn(BrowserThread::DB)) 334 if (!BrowserThread::CurrentlyOn(BrowserThread::DB))
336 return base::WeakPtr<syncer::SyncableService>();; 335 return base::WeakPtr<syncer::SyncableService>();
337 return AutofillProfileSyncableService::FromWebDataService(wds)->AsWeakPtr(); 336 return AutofillProfileSyncableService::FromWebDataService(wds)->AsWeakPtr();
338 } 337 }
339 338
340 class AbstractAutofillFactory { 339 class AbstractAutofillFactory {
341 public: 340 public:
342 virtual DataTypeController* CreateDataTypeController( 341 virtual DataTypeController* CreateDataTypeController(
343 ProfileSyncComponentsFactory* factory, 342 ProfileSyncComponentsFactory* factory,
344 ProfileMock* profile, 343 ProfileMock* profile,
345 ProfileSyncService* service) = 0; 344 ProfileSyncService* service) = 0;
346 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory, 345 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory,
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 std::vector<AutofillEntry> sync_entries; 1364 std::vector<AutofillEntry> sync_entries;
1366 std::vector<AutofillProfile> sync_profiles; 1365 std::vector<AutofillProfile> sync_profiles;
1367 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1368 EXPECT_EQ(3U, sync_entries.size()); 1367 EXPECT_EQ(3U, sync_entries.size());
1369 EXPECT_EQ(0U, sync_profiles.size()); 1368 EXPECT_EQ(0U, sync_profiles.size());
1370 for (size_t i = 0; i < sync_entries.size(); i++) { 1369 for (size_t i = 0; i < sync_entries.size(); i++) {
1371 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1372 << ", " << sync_entries[i].key().value(); 1371 << ", " << sync_entries[i].key().value();
1373 } 1372 }
1374 } 1373 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc ('k') | components/autofill.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698