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 <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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_) | 561 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_) |
562 ->UpdateCredentials(signin->GetAuthenticatedAccountId(), | 562 ->UpdateCredentials(signin->GetAuthenticatedAccountId(), |
563 "oauth2_login_token"); | 563 "oauth2_login_token"); |
564 | 564 |
565 sync_service_->RegisterDataTypeController(data_type_controller); | 565 sync_service_->RegisterDataTypeController(data_type_controller); |
566 sync_service_->Initialize(); | 566 sync_service_->Initialize(); |
567 base::MessageLoop::current()->Run(); | 567 base::MessageLoop::current()->Run(); |
568 | 568 |
569 // It's possible this test triggered an unrecoverable error, in which case | 569 // It's possible this test triggered an unrecoverable error, in which case |
570 // we can't get the sync count. | 570 // we can't get the sync count. |
571 if (sync_service_->SyncActive()) { | 571 if (sync_service_->IsSyncActive()) { |
572 EXPECT_EQ(GetSyncCount(type), | 572 EXPECT_EQ(GetSyncCount(type), |
573 association_stats_.num_sync_items_after_association); | 573 association_stats_.num_sync_items_after_association); |
574 } | 574 } |
575 EXPECT_EQ(association_stats_.num_sync_items_after_association, | 575 EXPECT_EQ(association_stats_.num_sync_items_after_association, |
576 association_stats_.num_sync_items_before_association + | 576 association_stats_.num_sync_items_before_association + |
577 association_stats_.num_sync_items_added - | 577 association_stats_.num_sync_items_added - |
578 association_stats_.num_sync_items_deleted); | 578 association_stats_.num_sync_items_deleted); |
579 } | 579 } |
580 | 580 |
581 bool AddAutofillSyncNode(const AutofillEntry& entry) { | 581 bool AddAutofillSyncNode(const AutofillEntry& entry) { |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 std::vector<AutofillEntry> sync_entries; | 1374 std::vector<AutofillEntry> sync_entries; |
1375 std::vector<AutofillProfile> sync_profiles; | 1375 std::vector<AutofillProfile> sync_profiles; |
1376 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); | 1376 ASSERT_TRUE(GetAutofillEntriesFromSyncDB(&sync_entries, &sync_profiles)); |
1377 EXPECT_EQ(3U, sync_entries.size()); | 1377 EXPECT_EQ(3U, sync_entries.size()); |
1378 EXPECT_EQ(0U, sync_profiles.size()); | 1378 EXPECT_EQ(0U, sync_profiles.size()); |
1379 for (size_t i = 0; i < sync_entries.size(); i++) { | 1379 for (size_t i = 0; i < sync_entries.size(); i++) { |
1380 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() | 1380 DVLOG(1) << "Entry " << i << ": " << sync_entries[i].key().name() |
1381 << ", " << sync_entries[i].key().value(); | 1381 << ", " << sync_entries[i].key().value(); |
1382 } | 1382 } |
1383 } | 1383 } |
OLD | NEW |