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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 if (node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != | 502 if (node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != |
503 syncer::BaseNode::INIT_OK) | 503 syncer::BaseNode::INIT_OK) |
504 return 0; | 504 return 0; |
505 return node.GetTotalNodeCount() - 1; | 505 return node.GetTotalNodeCount() - 1; |
506 } | 506 } |
507 | 507 |
508 void StartSyncService(const base::Closure& callback, | 508 void StartSyncService(const base::Closure& callback, |
509 bool will_fail_association, | 509 bool will_fail_association, |
510 syncer::ModelType type) { | 510 syncer::ModelType type) { |
511 AbstractAutofillFactory* factory = GetFactory(type); | 511 AbstractAutofillFactory* factory = GetFactory(type); |
512 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_.get()); | 512 SigninManagerBase* signin = |
| 513 SigninManagerFactory::GetForProfile(profile_.get()); |
513 signin->SetAuthenticatedUsername("test_user"); | 514 signin->SetAuthenticatedUsername("test_user"); |
514 sync_service_ = static_cast<TestProfileSyncService*>( | 515 sync_service_ = static_cast<TestProfileSyncService*>( |
515 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 516 ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
516 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit)); | 517 profile_.get(), &TestProfileSyncService::BuildAutoStartAsyncInit)); |
517 sync_service_->set_backend_init_callback(callback); | 518 sync_service_->set_backend_init_callback(callback); |
518 | 519 |
519 ProfileSyncComponentsFactoryMock* components = | 520 ProfileSyncComponentsFactoryMock* components = |
520 sync_service_->components_factory_mock(); | 521 sync_service_->components_factory_mock(); |
521 DataTypeController* data_type_controller = | 522 DataTypeController* data_type_controller = |
522 factory->CreateDataTypeController(components, | 523 factory->CreateDataTypeController(components, |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 std::vector<AutofillEntry> sync_entries; | 1349 std::vector<AutofillEntry> sync_entries; |
1349 std::vector<AutofillProfile> sync_profiles; | 1350 std::vector<AutofillProfile> sync_profiles; |
1350 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1351 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1351 EXPECT_EQ(3U, sync_entries.size()); | 1352 EXPECT_EQ(3U, sync_entries.size()); |
1352 EXPECT_EQ(0U, sync_profiles.size()); | 1353 EXPECT_EQ(0U, sync_profiles.size()); |
1353 for (size_t i = 0; i < sync_entries.size(); i++) { | 1354 for (size_t i = 0; i < sync_entries.size(); i++) { |
1354 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1355 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1355 << ", " << sync_entries[i].key().value(); | 1356 << ", " << sync_entries[i].key().value(); |
1356 } | 1357 } |
1357 } | 1358 } |
OLD | NEW |