OLD | NEW |
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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 if (node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != | 515 if (node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != |
516 syncer::BaseNode::INIT_OK) | 516 syncer::BaseNode::INIT_OK) |
517 return 0; | 517 return 0; |
518 return node.GetTotalNodeCount() - 1; | 518 return node.GetTotalNodeCount() - 1; |
519 } | 519 } |
520 | 520 |
521 void StartSyncService(const base::Closure& callback, | 521 void StartSyncService(const base::Closure& callback, |
522 bool will_fail_association, | 522 bool will_fail_association, |
523 syncer::ModelType type) { | 523 syncer::ModelType type) { |
524 AbstractAutofillFactory* factory = GetFactory(type); | 524 AbstractAutofillFactory* factory = GetFactory(type); |
525 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_.get()); | 525 SigninManagerBase* signin = |
| 526 SigninManagerFactory::GetForProfile(profile_.get()); |
526 signin->SetAuthenticatedUsername("test_user"); | 527 signin->SetAuthenticatedUsername("test_user"); |
527 sync_service_ = static_cast<TestProfileSyncService*>( | 528 sync_service_ = static_cast<TestProfileSyncService*>( |
528 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 529 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
529 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit)); | 530 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit)); |
530 sync_service_->set_backend_init_callback(callback); | 531 sync_service_->set_backend_init_callback(callback); |
531 | 532 |
532 ProfileSyncComponentsFactoryMock* components = | 533 ProfileSyncComponentsFactoryMock* components = |
533 sync_service_->components_factory_mock(); | 534 sync_service_->components_factory_mock(); |
534 DataTypeController* data_type_controller = | 535 DataTypeController* data_type_controller = |
535 factory->CreateDataTypeController(components, | 536 factory->CreateDataTypeController(components, |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 std::vector<AutofillEntry> sync_entries; | 1364 std::vector<AutofillEntry> sync_entries; |
1364 std::vector<AutofillProfile> sync_profiles; | 1365 std::vector<AutofillProfile> sync_profiles; |
1365 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1366 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1366 EXPECT_EQ(3U, sync_entries.size()); | 1367 EXPECT_EQ(3U, sync_entries.size()); |
1367 EXPECT_EQ(0U, sync_profiles.size()); | 1368 EXPECT_EQ(0U, sync_profiles.size()); |
1368 for (size_t i = 0; i < sync_entries.size(); i++) { | 1369 for (size_t i = 0; i < sync_entries.size(); i++) { |
1369 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1370 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1370 << ", " << sync_entries[i].key().value(); | 1371 << ", " << sync_entries[i].key().value(); |
1371 } | 1372 } |
1372 } | 1373 } |
OLD | NEW |