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

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

Issue 436733002: [Sync] Use OnSingleDataTypeUnrecoverableError for all errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More cleanup Created 6 years, 4 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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 DataTypeController* dtc) = 0; 385 DataTypeController* dtc) = 0;
386 virtual ~AbstractAutofillFactory() {} 386 virtual ~AbstractAutofillFactory() {}
387 }; 387 };
388 388
389 class AutofillEntryFactory : public AbstractAutofillFactory { 389 class AutofillEntryFactory : public AbstractAutofillFactory {
390 public: 390 public:
391 virtual DataTypeController* CreateDataTypeController( 391 virtual DataTypeController* CreateDataTypeController(
392 ProfileSyncComponentsFactory* factory, 392 ProfileSyncComponentsFactory* factory,
393 TestingProfile* profile, 393 TestingProfile* profile,
394 ProfileSyncService* service) OVERRIDE { 394 ProfileSyncService* service) OVERRIDE {
395 return new AutofillDataTypeController( 395 return new AutofillDataTypeController(factory, profile);
396 factory,
397 profile,
398 DataTypeController::DisableTypeCallback());
399 } 396 }
400 397
401 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory, 398 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory,
402 ProfileSyncService* service, 399 ProfileSyncService* service,
403 AutofillWebDataService* wds, 400 AutofillWebDataService* wds,
404 DataTypeController* dtc) OVERRIDE { 401 DataTypeController* dtc) OVERRIDE {
405 EXPECT_CALL(*factory, GetSyncableServiceForType(syncer::AUTOFILL)). 402 EXPECT_CALL(*factory, GetSyncableServiceForType(syncer::AUTOFILL)).
406 WillOnce(MakeAutocompleteSyncComponents(wds)); 403 WillOnce(MakeAutocompleteSyncComponents(wds));
407 } 404 }
408 }; 405 };
409 406
410 class AutofillProfileFactory : public AbstractAutofillFactory { 407 class AutofillProfileFactory : public AbstractAutofillFactory {
411 public: 408 public:
412 virtual DataTypeController* CreateDataTypeController( 409 virtual DataTypeController* CreateDataTypeController(
413 ProfileSyncComponentsFactory* factory, 410 ProfileSyncComponentsFactory* factory,
414 TestingProfile* profile, 411 TestingProfile* profile,
415 ProfileSyncService* service) OVERRIDE { 412 ProfileSyncService* service) OVERRIDE {
416 return new AutofillProfileDataTypeController( 413 return new AutofillProfileDataTypeController(factory, profile);
417 factory,
418 profile,
419 DataTypeController::DisableTypeCallback());
420 } 414 }
421 415
422 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory, 416 virtual void SetExpectation(ProfileSyncComponentsFactoryMock* factory,
423 ProfileSyncService* service, 417 ProfileSyncService* service,
424 AutofillWebDataService* wds, 418 AutofillWebDataService* wds,
425 DataTypeController* dtc) OVERRIDE { 419 DataTypeController* dtc) OVERRIDE {
426 EXPECT_CALL(*factory, 420 EXPECT_CALL(*factory,
427 GetSyncableServiceForType(syncer::AUTOFILL_PROFILE)). 421 GetSyncableServiceForType(syncer::AUTOFILL_PROFILE)).
428 WillOnce(MakeAutofillProfileSyncComponents(wds)); 422 WillOnce(MakeAutofillProfileSyncComponents(wds));
429 } 423 }
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 std::vector<AutofillEntry> sync_entries; 1381 std::vector<AutofillEntry> sync_entries;
1388 std::vector<AutofillProfile> sync_profiles; 1382 std::vector<AutofillProfile> sync_profiles;
1389 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1383 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1390 EXPECT_EQ(3U, sync_entries.size()); 1384 EXPECT_EQ(3U, sync_entries.size());
1391 EXPECT_EQ(0U, sync_profiles.size()); 1385 EXPECT_EQ(0U, sync_profiles.size());
1392 for (size_t i = 0; i < sync_entries.size(); i++) { 1386 for (size_t i = 0; i < sync_entries.size(); i++) {
1393 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1387 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1394 << ", " << sync_entries[i].key().value(); 1388 << ", " << sync_entries[i].key().value();
1395 } 1389 }
1396 } 1390 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698