OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
6 | 6 |
7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 7 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
8 #include "chrome/browser/sync/glue/data_type_controller.h" | 8 #include "chrome/browser/sync/glue/data_type_controller.h" |
9 #include "chrome/browser/sync/glue/sync_backend_host.h" | 9 #include "chrome/browser/sync/glue/sync_backend_host.h" |
10 #include "chrome/browser/sync/internal_api/user_share.h" | 10 #include "chrome/browser/sync/internal_api/user_share.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 : browser_sync::SyncBackendHost( | 55 : browser_sync::SyncBackendHost( |
56 profile->GetDebugName(), profile, sync_prefs), | 56 profile->GetDebugName(), profile, sync_prefs), |
57 synchronous_init_(synchronous_init), | 57 synchronous_init_(synchronous_init), |
58 fail_initial_download_(fail_initial_download) {} | 58 fail_initial_download_(fail_initial_download) {} |
59 | 59 |
60 SyncBackendHostForProfileSyncTest::~SyncBackendHostForProfileSyncTest() {} | 60 SyncBackendHostForProfileSyncTest::~SyncBackendHostForProfileSyncTest() {} |
61 | 61 |
62 void SyncBackendHostForProfileSyncTest:: | 62 void SyncBackendHostForProfileSyncTest:: |
63 SimulateSyncCycleCompletedInitialSyncEnded( | 63 SimulateSyncCycleCompletedInitialSyncEnded( |
64 const tracked_objects::Location& location) { | 64 const tracked_objects::Location& location) { |
65 syncable::ModelEnumSet sync_ended; | 65 syncable::ModelTypeSet sync_ended; |
66 if (!fail_initial_download_) | 66 if (!fail_initial_download_) |
67 sync_ended = syncable::ModelEnumSet::All(); | 67 sync_ended = syncable::ModelTypeSet::All(); |
68 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; | 68 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; |
69 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 69 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
70 SyncerStatus(), ErrorCounters(), 0, false, | 70 SyncerStatus(), ErrorCounters(), 0, false, |
71 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 71 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
72 SyncSourceInfo(), 0, base::Time::Now())); | 72 SyncSourceInfo(), 0, base::Time::Now())); |
73 } | 73 } |
74 | 74 |
75 sync_api::HttpPostProviderFactory* | 75 sync_api::HttpPostProviderFactory* |
76 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( | 76 SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( |
77 const scoped_refptr<net::URLRequestContextGetter>& getter) { | 77 const scoped_refptr<net::URLRequestContextGetter>& getter) { |
(...skipping 13 matching lines...) Expand all Loading... |
91 // The SyncBackend posts a task to the current loop when | 91 // The SyncBackend posts a task to the current loop when |
92 // initialization completes. | 92 // initialization completes. |
93 MessageLoop::current()->Run(); | 93 MessageLoop::current()->Run(); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 void SyncBackendHostForProfileSyncTest::StartConfiguration( | 97 void SyncBackendHostForProfileSyncTest::StartConfiguration( |
98 const base::Closure& callback) { | 98 const base::Closure& callback) { |
99 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); | 99 SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); |
100 if (initialization_state_ == DOWNLOADING_NIGORI) { | 100 if (initialization_state_ == DOWNLOADING_NIGORI) { |
101 syncable::ModelEnumSet sync_ended; | 101 syncable::ModelTypeSet sync_ended; |
102 | 102 |
103 if (!fail_initial_download_) | 103 if (!fail_initial_download_) |
104 sync_ended.Put(syncable::NIGORI); | 104 sync_ended.Put(syncable::NIGORI); |
105 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; | 105 std::string download_progress_markers[syncable::MODEL_TYPE_COUNT]; |
106 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( | 106 core_->HandleSyncCycleCompletedOnFrontendLoop(new SyncSessionSnapshot( |
107 SyncerStatus(), ErrorCounters(), 0, false, | 107 SyncerStatus(), ErrorCounters(), 0, false, |
108 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, | 108 sync_ended, download_progress_markers, false, false, 0, 0, 0, false, |
109 SyncSourceInfo(), 0, base::Time::Now())); | 109 SyncSourceInfo(), 0, base::Time::Now())); |
110 } | 110 } |
111 } | 111 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 238 } |
239 | 239 |
240 void TestProfileSyncService::CreateBackend() { | 240 void TestProfileSyncService::CreateBackend() { |
241 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( | 241 backend_.reset(new browser_sync::SyncBackendHostForProfileSyncTest( |
242 profile(), | 242 profile(), |
243 sync_prefs_.AsWeakPtr(), | 243 sync_prefs_.AsWeakPtr(), |
244 set_initial_sync_ended_on_init_, | 244 set_initial_sync_ended_on_init_, |
245 synchronous_backend_initialization_, | 245 synchronous_backend_initialization_, |
246 fail_initial_download_)); | 246 fail_initial_download_)); |
247 } | 247 } |
OLD | NEW |