OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/sync/glue/sync_backend_host.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 syncer::ModelTypeSet new_types(syncer::EXPERIMENTS, syncer::DEVICE_INFO); | 684 syncer::ModelTypeSet new_types(syncer::EXPERIMENTS, syncer::DEVICE_INFO); |
685 syncer::ModelTypeSet old_types = | 685 syncer::ModelTypeSet old_types = |
686 Difference(enabled_types_, new_types); | 686 Difference(enabled_types_, new_types); |
687 fake_manager_factory_.set_progress_marker_types(old_types); | 687 fake_manager_factory_.set_progress_marker_types(old_types); |
688 fake_manager_factory_.set_initial_sync_ended_types(old_types); | 688 fake_manager_factory_.set_initial_sync_ended_types(old_types); |
689 | 689 |
690 // Bringing up the backend should download the new types without downloading | 690 // Bringing up the backend should download the new types without downloading |
691 // any old types. | 691 // any old types. |
692 InitializeBackend(true); | 692 InitializeBackend(true); |
693 EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().Equals(new_types)); | 693 EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().Equals(new_types)); |
694 EXPECT_TRUE(Intersection(fake_manager_->GetAndResetCleanedTypes(), | 694 EXPECT_TRUE(fake_manager_->GetAndResetCleanedTypes().Equals( |
695 enabled_types_).Empty()); | 695 Difference(syncer::ModelTypeSet::All(), |
| 696 enabled_types_))); |
696 EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(enabled_types_)); | 697 EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(enabled_types_)); |
697 EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( | 698 EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( |
698 enabled_types_).Empty()); | 699 enabled_types_).Empty()); |
699 } | 700 } |
700 | 701 |
701 // Fail to download control types. It's believed that there is a server bug | 702 // Fail to download control types. It's believed that there is a server bug |
702 // which can allow this to happen (crbug.com/164288). The sync backend host | 703 // which can allow this to happen (crbug.com/164288). The sync backend host |
703 // should detect this condition and fail to initialize the backend. | 704 // should detect this condition and fail to initialize the backend. |
704 // | 705 // |
705 // The failure is "silent" in the sense that the GetUpdates request appears to | 706 // The failure is "silent" in the sense that the GetUpdates request appears to |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) { | 763 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) { |
763 sync_prefs_->SetSyncSetupCompleted(); | 764 sync_prefs_->SetSyncSetupCompleted(); |
764 InitializeBackend(true); | 765 InitializeBackend(true); |
765 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, | 766 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, |
766 fake_manager_->GetAndResetConfigureReason()); | 767 fake_manager_->GetAndResetConfigureReason()); |
767 } | 768 } |
768 | 769 |
769 } // namespace | 770 } // namespace |
770 | 771 |
771 } // namespace browser_sync | 772 } // namespace browser_sync |
OLD | NEW |