| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, | 124 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
| 125 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 125 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
| 126 const GURL& service_url, | 126 const GURL& service_url, |
| 127 const std::string& sync_user_agent, | 127 const std::string& sync_user_agent, |
| 128 const syncer::SyncCredentials& credentials, | 128 const syncer::SyncCredentials& credentials, |
| 129 bool delete_sync_data_folder, | 129 bool delete_sync_data_folder, |
| 130 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 130 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
| 131 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& | 131 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
| 132 unrecoverable_error_handler, | 132 unrecoverable_error_handler, |
| 133 const base::Closure& report_unrecoverable_error_function, | 133 const base::Closure& report_unrecoverable_error_function, |
| 134 syncer::NetworkResources* network_resources, | 134 const HttpPostProviderFactoryGetter& get_http_post_provider_factory, |
| 135 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) | 135 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) |
| 136 override {} | 136 override {} |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 class SyncBackendHostMockCollectDeleteDirParam : public SyncBackendHostMock { | 139 class SyncBackendHostMockCollectDeleteDirParam : public SyncBackendHostMock { |
| 140 public: | 140 public: |
| 141 explicit SyncBackendHostMockCollectDeleteDirParam( | 141 explicit SyncBackendHostMockCollectDeleteDirParam( |
| 142 std::vector<bool>* delete_dir_param) | 142 std::vector<bool>* delete_dir_param) |
| 143 : delete_dir_param_(delete_dir_param) {} | 143 : delete_dir_param_(delete_dir_param) {} |
| 144 | 144 |
| 145 void Initialize( | 145 void Initialize( |
| 146 sync_driver::SyncFrontend* frontend, | 146 sync_driver::SyncFrontend* frontend, |
| 147 scoped_ptr<base::Thread> sync_thread, | 147 scoped_ptr<base::Thread> sync_thread, |
| 148 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 148 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
| 149 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, | 149 const scoped_refptr<base::SingleThreadTaskRunner>& file_thread, |
| 150 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 150 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
| 151 const GURL& service_url, | 151 const GURL& service_url, |
| 152 const std::string& sync_user_agent, | 152 const std::string& sync_user_agent, |
| 153 const syncer::SyncCredentials& credentials, | 153 const syncer::SyncCredentials& credentials, |
| 154 bool delete_sync_data_folder, | 154 bool delete_sync_data_folder, |
| 155 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 155 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
| 156 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& | 156 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
| 157 unrecoverable_error_handler, | 157 unrecoverable_error_handler, |
| 158 const base::Closure& report_unrecoverable_error_function, | 158 const base::Closure& report_unrecoverable_error_function, |
| 159 syncer::NetworkResources* network_resources, | 159 const HttpPostProviderFactoryGetter& get_http_post_provider_factory, |
| 160 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) | 160 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) |
| 161 override { | 161 override { |
| 162 delete_dir_param_->push_back(delete_sync_data_folder); | 162 delete_dir_param_->push_back(delete_sync_data_folder); |
| 163 SyncBackendHostMock::Initialize( | 163 SyncBackendHostMock::Initialize( |
| 164 frontend, sync_thread.Pass(), db_thread, file_thread, event_handler, | 164 frontend, sync_thread.Pass(), db_thread, file_thread, event_handler, |
| 165 service_url, sync_user_agent, credentials, delete_sync_data_folder, | 165 service_url, sync_user_agent, credentials, delete_sync_data_folder, |
| 166 sync_manager_factory.Pass(), unrecoverable_error_handler, | 166 sync_manager_factory.Pass(), unrecoverable_error_handler, |
| 167 report_unrecoverable_error_function, network_resources, | 167 report_unrecoverable_error_function, get_http_post_provider_factory, |
| 168 saved_nigori_state.Pass()); | 168 saved_nigori_state.Pass()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 std::vector<bool>* delete_dir_param_; | 172 std::vector<bool>* delete_dir_param_; |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 // SyncBackendHostMock that calls an external callback when ClearServerData is | 175 // SyncBackendHostMock that calls an external callback when ClearServerData is |
| 176 // called. | 176 // called. |
| 177 class SyncBackendHostCaptureClearServerData : public SyncBackendHostMock { | 177 class SyncBackendHostCaptureClearServerData : public SyncBackendHostMock { |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 InitializeForNthSync(); | 996 InitializeForNthSync(); |
| 997 | 997 |
| 998 syncer::SyncProtocolError client_cmd; | 998 syncer::SyncProtocolError client_cmd; |
| 999 client_cmd.action = syncer::RESET_LOCAL_SYNC_DATA; | 999 client_cmd.action = syncer::RESET_LOCAL_SYNC_DATA; |
| 1000 service()->OnActionableError(client_cmd); | 1000 service()->OnActionableError(client_cmd); |
| 1001 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode()); | 1001 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode()); |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 } // namespace | 1004 } // namespace |
| 1005 } // namespace browser_sync | 1005 } // namespace browser_sync |
| OLD | NEW |