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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 profile()->ResetRequestContext(); | 205 profile()->ResetRequestContext(); |
206 | 206 |
207 // We need to destroy the profile before shutting down the threads, because | 207 // We need to destroy the profile before shutting down the threads, because |
208 // some of the ref counted objects in the profile depend on their | 208 // some of the ref counted objects in the profile depend on their |
209 // destruction on the io thread. | 209 // destruction on the io thread. |
210 DestroyBrowserAndProfile(); | 210 DestroyBrowserAndProfile(); |
211 set_profile(NULL); | 211 set_profile(NULL); |
212 | 212 |
213 // Pump messages posted by the sync core thread (which may end up | 213 // Pump messages posted by the sync core thread (which may end up |
214 // posting on the IO thread). | 214 // posting on the IO thread). |
215 MessageLoop::current()->RunAllPending(); | 215 MessageLoop::current()->RunUntilIdle(); |
216 io_thread_.Stop(); | 216 io_thread_.Stop(); |
217 MessageLoop::current()->RunAllPending(); | 217 MessageLoop::current()->RunUntilIdle(); |
218 BrowserWithTestWindowTest::TearDown(); | 218 BrowserWithTestWindowTest::TearDown(); |
219 } | 219 } |
220 | 220 |
221 bool StartSyncService(const base::Closure& callback, | 221 bool StartSyncService(const base::Closure& callback, |
222 bool will_fail_association) { | 222 bool will_fail_association) { |
223 if (sync_service_.get()) | 223 if (sync_service_.get()) |
224 return false; | 224 return false; |
225 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); | 225 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); |
226 signin->SetAuthenticatedUsername("test_user"); | 226 signin->SetAuthenticatedUsername("test_user"); |
227 ProfileSyncComponentsFactoryMock* factory = | 227 ProfileSyncComponentsFactoryMock* factory = |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 sync_pb::SessionSpecifics specifics; | 1196 sync_pb::SessionSpecifics specifics; |
1197 header.SetSessionSpecifics(specifics); | 1197 header.SetSessionSpecifics(specifics); |
1198 } | 1198 } |
1199 // Ensure we associate properly despite the pre-existing node with our local | 1199 // Ensure we associate properly despite the pre-existing node with our local |
1200 // tag. | 1200 // tag. |
1201 error = model_associator_->AssociateModels(NULL, NULL); | 1201 error = model_associator_->AssociateModels(NULL, NULL); |
1202 ASSERT_FALSE(error.IsSet()); | 1202 ASSERT_FALSE(error.IsSet()); |
1203 } | 1203 } |
1204 | 1204 |
1205 } // namespace browser_sync | 1205 } // namespace browser_sync |
OLD | NEW |