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/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 void TearDown() { | 76 void TearDown() { |
77 // Kill the service before the profile. | 77 // Kill the service before the profile. |
78 if (service.get()) { | 78 if (service.get()) { |
79 service->Shutdown(); | 79 service->Shutdown(); |
80 } | 80 } |
81 service.reset(); | 81 service.reset(); |
82 profile.reset(); | 82 profile.reset(); |
83 // Pump messages posted by the sync thread (which may end up | 83 // Pump messages posted by the sync thread (which may end up |
84 // posting on the IO thread). | 84 // posting on the IO thread). |
85 ui_loop_.RunAllPending(); | 85 ui_loop_.RunUntilIdle(); |
86 io_thread_.Stop(); | 86 io_thread_.Stop(); |
87 file_thread_.Stop(); | 87 file_thread_.Stop(); |
88 // Ensure that the sync objects destruct to avoid memory leaks. | 88 // Ensure that the sync objects destruct to avoid memory leaks. |
89 ui_loop_.RunAllPending(); | 89 ui_loop_.RunUntilIdle(); |
90 } | 90 } |
91 | 91 |
92 // TODO(akalin): Refactor the StartSyncService*() functions below. | 92 // TODO(akalin): Refactor the StartSyncService*() functions below. |
93 | 93 |
94 void StartSyncService() { | 94 void StartSyncService() { |
95 StartSyncServiceAndSetInitialSyncEnded( | 95 StartSyncServiceAndSetInitialSyncEnded( |
96 true, true, false, true, syncer::STORAGE_IN_MEMORY); | 96 true, true, false, true, syncer::STORAGE_IN_MEMORY); |
97 } | 97 } |
98 | 98 |
99 void StartSyncServiceAndSetInitialSyncEnded( | 99 void StartSyncServiceAndSetInitialSyncEnded( |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 namespace syncer { | 575 namespace syncer { |
576 namespace { | 576 namespace { |
577 | 577 |
578 // ProfileSyncService should behave just like an invalidator. | 578 // ProfileSyncService should behave just like an invalidator. |
579 INSTANTIATE_TYPED_TEST_CASE_P( | 579 INSTANTIATE_TYPED_TEST_CASE_P( |
580 ProfileSyncServiceInvalidatorTest, InvalidatorTest, | 580 ProfileSyncServiceInvalidatorTest, InvalidatorTest, |
581 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); | 581 ::browser_sync::ProfileSyncServiceInvalidatorTestDelegate); |
582 | 582 |
583 } // namespace | 583 } // namespace |
584 } // namespace syncer | 584 } // namespace syncer |
OLD | NEW |