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

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

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 return 0; 518 return 0;
519 return node.GetTotalNodeCount() - 1; 519 return node.GetTotalNodeCount() - 1;
520 } 520 }
521 521
522 void StartSyncService(const base::Closure& callback, 522 void StartSyncService(const base::Closure& callback,
523 bool will_fail_association, 523 bool will_fail_association,
524 syncer::ModelType type) { 524 syncer::ModelType type) {
525 AbstractAutofillFactory* factory = GetFactory(type); 525 AbstractAutofillFactory* factory = GetFactory(type);
526 SigninManagerBase* signin = 526 SigninManagerBase* signin =
527 SigninManagerFactory::GetForProfile(profile_.get()); 527 SigninManagerFactory::GetForProfile(profile_.get());
528 signin->SetAuthenticatedUsername("test_user"); 528 signin->SetAuthenticatedUsername("test_user@gmail.com");
rlarocque 2013/05/21 20:51:36 The invalidator can get upset if it finds the user
529 sync_service_ = static_cast<TestProfileSyncService*>( 529 sync_service_ = static_cast<TestProfileSyncService*>(
530 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( 530 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
531 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit)); 531 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit));
532 sync_service_->set_backend_init_callback(callback); 532 sync_service_->set_backend_init_callback(callback);
533 533
534 ProfileSyncComponentsFactoryMock* components = 534 ProfileSyncComponentsFactoryMock* components =
535 sync_service_->components_factory_mock(); 535 sync_service_->components_factory_mock();
536 DataTypeController* data_type_controller = 536 DataTypeController* data_type_controller =
537 factory->CreateDataTypeController(components, 537 factory->CreateDataTypeController(components,
538 profile_.get(), 538 profile_.get(),
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 std::vector<AutofillEntry> sync_entries; 1364 std::vector<AutofillEntry> sync_entries;
1365 std::vector<AutofillProfile> sync_profiles; 1365 std::vector<AutofillProfile> sync_profiles;
1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); 1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles));
1367 EXPECT_EQ(3U, sync_entries.size()); 1367 EXPECT_EQ(3U, sync_entries.size());
1368 EXPECT_EQ(0U, sync_profiles.size()); 1368 EXPECT_EQ(0U, sync_profiles.size());
1369 for (size_t i = 0; i < sync_entries.size(); i++) { 1369 for (size_t i = 0; i < sync_entries.size(); i++) {
1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() 1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name()
1371 << ", " << sync_entries[i].key().value(); 1371 << ", " << sync_entries[i].key().value();
1372 } 1372 }
1373 } 1373 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698