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

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

Issue 72613006: Eliminate AutofillWebDataService::FromBrowserContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 autofill::PersonalDataManagerFactory::GetInstance() 522 autofill::PersonalDataManagerFactory::GetInstance()
523 ->SetTestingFactoryAndUse( 523 ->SetTestingFactoryAndUse(
524 profile_.get(), MockPersonalDataManagerService::Build)); 524 profile_.get(), MockPersonalDataManagerService::Build));
525 personal_data_manager_ = 525 personal_data_manager_ =
526 personal_data_manager_service->GetPersonalDataManager(); 526 personal_data_manager_service->GetPersonalDataManager();
527 527
528 EXPECT_CALL(*personal_data_manager_, LoadProfiles()).Times(1); 528 EXPECT_CALL(*personal_data_manager_, LoadProfiles()).Times(1);
529 EXPECT_CALL(*personal_data_manager_, LoadCreditCards()).Times(1); 529 EXPECT_CALL(*personal_data_manager_, LoadCreditCards()).Times(1);
530 530
531 personal_data_manager_->Init( 531 personal_data_manager_->Init(
532 autofill::AutofillWebDataService::FromBrowserContext(profile_.get()), 532 WebDataServiceFactory::GetAutofillWebDataForProfile(
533 profile_.get(), Profile::EXPLICIT_ACCESS),
533 profile_->GetPrefs(), 534 profile_->GetPrefs(),
534 profile_->IsOffTheRecord()); 535 profile_->IsOffTheRecord());
535 536
536 web_data_service_->StartSyncableService(); 537 web_data_service_->StartSyncableService();
537 } 538 }
538 539
539 virtual void TearDown() OVERRIDE { 540 virtual void TearDown() OVERRIDE {
540 // Note: The tear down order is important. 541 // Note: The tear down order is important.
541 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory( 542 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(
542 profile_.get(), NULL); 543 profile_.get(), NULL);
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 std::vector<AutofillEntry> sync_entries; 1405 std::vector<AutofillEntry> sync_entries;
1405 std::vector<AutofillProfile> sync_profiles; 1406 std::vector<AutofillProfile> sync_profiles;
1406 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1407 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1407 EXPECT_EQ(3U, sync_entries.size()); 1408 EXPECT_EQ(3U, sync_entries.size());
1408 EXPECT_EQ(0U, sync_profiles.size()); 1409 EXPECT_EQ(0U, sync_profiles.size());
1409 for (size_t i = 0; i < sync_entries.size(); i++) { 1410 for (size_t i = 0; i < sync_entries.size(); i++) {
1410 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1411 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1411 << ", " << sync_entries[i].key().value(); 1412 << ", " << sync_entries[i].key().value();
1412 } 1413 }
1413 } 1414 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_impl.cc ('k') | chrome/browser/sync/test/integration/autofill_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698