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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Pump any messages posted by the IO thread. | 187 // Pump any messages posted by the IO thread. |
188 ui_loop_.RunUntilIdle(); | 188 ui_loop_.RunUntilIdle(); |
189 } | 189 } |
190 | 190 |
191 // Synchronously initializes the backend. | 191 // Synchronously initializes the backend. |
192 void InitializeBackend(bool expect_success) { | 192 void InitializeBackend(bool expect_success) { |
193 EXPECT_CALL(mock_frontend_, OnBackendInitialized(_, _, expect_success)). | 193 EXPECT_CALL(mock_frontend_, OnBackendInitialized(_, _, expect_success)). |
194 WillOnce(InvokeWithoutArgs(QuitMessageLoop)); | 194 WillOnce(InvokeWithoutArgs(QuitMessageLoop)); |
195 backend_->Initialize(&mock_frontend_, | 195 backend_->Initialize(&mock_frontend_, |
196 syncer::WeakHandle<syncer::JsEventHandler>(), | 196 syncer::WeakHandle<syncer::JsEventHandler>(), |
197 GURL(""), | 197 GURL(std::string()), |
198 credentials_, | 198 credentials_, |
199 true, | 199 true, |
200 &fake_manager_factory_, | 200 &fake_manager_factory_, |
201 &handler_, | 201 &handler_, |
202 NULL); | 202 NULL); |
203 ui_loop_.PostDelayedTask(FROM_HERE, | 203 ui_loop_.PostDelayedTask(FROM_HERE, |
204 ui_loop_.QuitClosure(), TestTimeouts::action_timeout()); | 204 ui_loop_.QuitClosure(), TestTimeouts::action_timeout()); |
205 ui_loop_.Run(); | 205 ui_loop_.Run(); |
206 // |fake_manager_factory_|'s fake_manager() is set on the sync | 206 // |fake_manager_factory_|'s fake_manager() is set on the sync |
207 // thread, but we can rely on the message loop barriers to | 207 // thread, but we can rely on the message loop barriers to |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 fake_manager_->WaitForSyncThread(); | 744 fake_manager_->WaitForSyncThread(); |
745 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); | 745 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); |
746 | 746 |
747 backend_->Shutdown(false); | 747 backend_->Shutdown(false); |
748 backend_.reset(); | 748 backend_.reset(); |
749 } | 749 } |
750 | 750 |
751 } // namespace | 751 } // namespace |
752 | 752 |
753 } // namespace browser_sync | 753 } // namespace browser_sync |
OLD | NEW |