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/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // that could happen while backend init is in progress. | 108 // that could happen while backend init is in progress. |
109 class SyncBackendHostNoReturn : public SyncBackendHostMock { | 109 class SyncBackendHostNoReturn : public SyncBackendHostMock { |
110 void Initialize( | 110 void Initialize( |
111 sync_driver::SyncFrontend* frontend, | 111 sync_driver::SyncFrontend* frontend, |
112 scoped_ptr<base::Thread> sync_thread, | 112 scoped_ptr<base::Thread> sync_thread, |
113 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 113 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
114 const GURL& service_url, | 114 const GURL& service_url, |
115 const syncer::SyncCredentials& credentials, | 115 const syncer::SyncCredentials& credentials, |
116 bool delete_sync_data_folder, | 116 bool delete_sync_data_folder, |
117 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 117 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
118 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, | 118 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
| 119 unrecoverable_error_handler, |
119 const base::Closure& report_unrecoverable_error_function, | 120 const base::Closure& report_unrecoverable_error_function, |
120 syncer::NetworkResources* network_resources, | 121 syncer::NetworkResources* network_resources, |
121 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) | 122 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) |
122 override {} | 123 override {} |
123 }; | 124 }; |
124 | 125 |
125 class SyncBackendHostMockCollectDeleteDirParam : public SyncBackendHostMock { | 126 class SyncBackendHostMockCollectDeleteDirParam : public SyncBackendHostMock { |
126 public: | 127 public: |
127 explicit SyncBackendHostMockCollectDeleteDirParam( | 128 explicit SyncBackendHostMockCollectDeleteDirParam( |
128 std::vector<bool>* delete_dir_param) | 129 std::vector<bool>* delete_dir_param) |
129 : delete_dir_param_(delete_dir_param) {} | 130 : delete_dir_param_(delete_dir_param) {} |
130 | 131 |
131 void Initialize( | 132 void Initialize( |
132 sync_driver::SyncFrontend* frontend, | 133 sync_driver::SyncFrontend* frontend, |
133 scoped_ptr<base::Thread> sync_thread, | 134 scoped_ptr<base::Thread> sync_thread, |
134 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, | 135 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, |
135 const GURL& service_url, | 136 const GURL& service_url, |
136 const syncer::SyncCredentials& credentials, | 137 const syncer::SyncCredentials& credentials, |
137 bool delete_sync_data_folder, | 138 bool delete_sync_data_folder, |
138 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, | 139 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, |
139 scoped_ptr<syncer::UnrecoverableErrorHandler> unrecoverable_error_handler, | 140 const syncer::WeakHandle<syncer::UnrecoverableErrorHandler>& |
| 141 unrecoverable_error_handler, |
140 const base::Closure& report_unrecoverable_error_function, | 142 const base::Closure& report_unrecoverable_error_function, |
141 syncer::NetworkResources* network_resources, | 143 syncer::NetworkResources* network_resources, |
142 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) | 144 scoped_ptr<syncer::SyncEncryptionHandler::NigoriState> saved_nigori_state) |
143 override { | 145 override { |
144 delete_dir_param_->push_back(delete_sync_data_folder); | 146 delete_dir_param_->push_back(delete_sync_data_folder); |
145 SyncBackendHostMock::Initialize(frontend, sync_thread.Pass(), | 147 SyncBackendHostMock::Initialize(frontend, sync_thread.Pass(), |
146 event_handler, service_url, credentials, | 148 event_handler, service_url, credentials, |
147 delete_sync_data_folder, | 149 delete_sync_data_folder, |
148 sync_manager_factory.Pass(), | 150 sync_manager_factory.Pass(), |
149 unrecoverable_error_handler.Pass(), | 151 unrecoverable_error_handler, |
150 report_unrecoverable_error_function, | 152 report_unrecoverable_error_function, |
151 network_resources, | 153 network_resources, |
152 saved_nigori_state.Pass()); | 154 saved_nigori_state.Pass()); |
153 } | 155 } |
154 | 156 |
155 private: | 157 private: |
156 std::vector<bool>* delete_dir_param_; | 158 std::vector<bool>* delete_dir_param_; |
157 }; | 159 }; |
158 | 160 |
159 ACTION(ReturnNewSyncBackendHostMock) { | 161 ACTION(ReturnNewSyncBackendHostMock) { |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 ExpectDataTypeManagerCreation(1); | 720 ExpectDataTypeManagerCreation(1); |
719 ExpectSyncBackendHostCreation(1); | 721 ExpectSyncBackendHostCreation(1); |
720 const syncer::SyncEncryptionHandler::NigoriState nigori_state; | 722 const syncer::SyncEncryptionHandler::NigoriState nigori_state; |
721 service()->OnLocalSetPassphraseEncryption(nigori_state); | 723 service()->OnLocalSetPassphraseEncryption(nigori_state); |
722 PumpLoop(); | 724 PumpLoop(); |
723 testing::Mock::VerifyAndClearExpectations(components_factory()); | 725 testing::Mock::VerifyAndClearExpectations(components_factory()); |
724 } | 726 } |
725 | 727 |
726 } // namespace | 728 } // namespace |
727 } // namespace browser_sync | 729 } // namespace browser_sync |
OLD | NEW |