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

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

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

Powered by Google App Engine
This is Rietveld 408576698