OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_impl.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 enabled_types_.Put(syncer::SEARCH_ENGINES); | 185 enabled_types_.Put(syncer::SEARCH_ENGINES); |
186 enabled_types_.Put(syncer::AUTOFILL); | 186 enabled_types_.Put(syncer::AUTOFILL); |
187 enabled_types_.Put(syncer::EXPERIMENTS); | 187 enabled_types_.Put(syncer::EXPERIMENTS); |
188 | 188 |
189 network_resources_.reset(new syncer::HttpBridgeNetworkResources()); | 189 network_resources_.reset(new syncer::HttpBridgeNetworkResources()); |
190 } | 190 } |
191 | 191 |
192 virtual void TearDown() OVERRIDE { | 192 virtual void TearDown() OVERRIDE { |
193 if (backend_) { | 193 if (backend_) { |
194 backend_->StopSyncingForShutdown(); | 194 backend_->StopSyncingForShutdown(); |
195 backend_->Shutdown(SyncBackendHost::STOP); | 195 backend_->Shutdown(syncer::STOP_SYNC); |
196 } | 196 } |
197 backend_.reset(); | 197 backend_.reset(); |
198 sync_prefs_.reset(); | 198 sync_prefs_.reset(); |
199 profile_ = NULL; | 199 profile_ = NULL; |
200 profile_manager_.DeleteTestingProfile(kTestProfileName); | 200 profile_manager_.DeleteTestingProfile(kTestProfileName); |
201 // Pump messages posted by the sync thread (which may end up | 201 // Pump messages posted by the sync thread (which may end up |
202 // posting on the IO thread). | 202 // posting on the IO thread). |
203 base::RunLoop().RunUntilIdle(); | 203 base::RunLoop().RunUntilIdle(); |
204 content::RunAllPendingInMessageLoop(BrowserThread::IO); | 204 content::RunAllPendingInMessageLoop(BrowserThread::IO); |
205 // Pump any messages posted by the IO thread. | 205 // Pump any messages posted by the IO thread. |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 TEST_F(SyncBackendHostTest, AttemptForwardLocalRefreshRequestLate) { | 707 TEST_F(SyncBackendHostTest, AttemptForwardLocalRefreshRequestLate) { |
708 InitializeBackend(true); | 708 InitializeBackend(true); |
709 | 709 |
710 backend_->StopSyncingForShutdown(); | 710 backend_->StopSyncingForShutdown(); |
711 | 711 |
712 syncer::ModelTypeSet types = syncer::ModelTypeSet::All(); | 712 syncer::ModelTypeSet types = syncer::ModelTypeSet::All(); |
713 IssueRefreshRequest(types); | 713 IssueRefreshRequest(types); |
714 fake_manager_->WaitForSyncThread(); | 714 fake_manager_->WaitForSyncThread(); |
715 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); | 715 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); |
716 | 716 |
717 backend_->Shutdown(SyncBackendHost::STOP); | 717 backend_->Shutdown(syncer::STOP_SYNC); |
718 backend_.reset(); | 718 backend_.reset(); |
719 } | 719 } |
720 | 720 |
721 // Test that configuration on signin sends the proper GU source. | 721 // Test that configuration on signin sends the proper GU source. |
722 TEST_F(SyncBackendHostTest, DownloadControlTypesNewClient) { | 722 TEST_F(SyncBackendHostTest, DownloadControlTypesNewClient) { |
723 InitializeBackend(true); | 723 InitializeBackend(true); |
724 EXPECT_EQ(syncer::CONFIGURE_REASON_NEW_CLIENT, | 724 EXPECT_EQ(syncer::CONFIGURE_REASON_NEW_CLIENT, |
725 fake_manager_->GetAndResetConfigureReason()); | 725 fake_manager_->GetAndResetConfigureReason()); |
726 } | 726 } |
727 | 727 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 Difference(syncer::ModelTypeSet::All(), | 779 Difference(syncer::ModelTypeSet::All(), |
780 enabled_types_), | 780 enabled_types_), |
781 syncer::ModelTypeSet()); | 781 syncer::ModelTypeSet()); |
782 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( | 782 EXPECT_FALSE(fake_manager_->GetTypesWithEmptyProgressMarkerToken( |
783 error_types).Empty()); | 783 error_types).Empty()); |
784 } | 784 } |
785 | 785 |
786 } // namespace | 786 } // namespace |
787 | 787 |
788 } // namespace browser_sync | 788 } // namespace browser_sync |
OLD | NEW |