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/abstract_profile_sync_service_test.h" | 5 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "chrome/browser/sync/test_profile_sync_service.h" | 10 #include "chrome/browser/sync/test_profile_sync_service.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 void AbstractProfileSyncServiceTest::SetUp() { | 52 void AbstractProfileSyncServiceTest::SetUp() { |
53 db_thread_.Start(); | 53 db_thread_.Start(); |
54 file_thread_.Start(); | 54 file_thread_.Start(); |
55 io_thread_.StartIOThread(); | 55 io_thread_.StartIOThread(); |
56 } | 56 } |
57 | 57 |
58 void AbstractProfileSyncServiceTest::TearDown() { | 58 void AbstractProfileSyncServiceTest::TearDown() { |
59 // Pump messages posted by the sync core thread (which may end up | 59 // Pump messages posted by the sync core thread (which may end up |
60 // posting on the IO thread). | 60 // posting on the IO thread). |
61 ui_loop_.RunAllPending(); | 61 ui_loop_.RunUntilIdle(); |
62 io_thread_.Stop(); | 62 io_thread_.Stop(); |
63 file_thread_.Stop(); | 63 file_thread_.Stop(); |
64 db_thread_.Stop(); | 64 db_thread_.Stop(); |
65 ui_loop_.RunAllPending(); | 65 ui_loop_.RunUntilIdle(); |
66 } | 66 } |
67 | 67 |
68 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { | 68 bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { |
69 return syncer::TestUserShare::CreateRoot(model_type, | 69 return syncer::TestUserShare::CreateRoot(model_type, |
70 service_->GetUserShare()); | 70 service_->GetUserShare()); |
71 } | 71 } |
72 | 72 |
73 // static | 73 // static |
74 ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( | 74 ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( |
75 Profile* profile) { | 75 Profile* profile) { |
(...skipping 17 matching lines...) Expand all Loading... |
93 return callback_; | 93 return callback_; |
94 } | 94 } |
95 | 95 |
96 bool CreateRootHelper::success() { | 96 bool CreateRootHelper::success() { |
97 return success_; | 97 return success_; |
98 } | 98 } |
99 | 99 |
100 void CreateRootHelper::CreateRootCallback() { | 100 void CreateRootHelper::CreateRootCallback() { |
101 success_ = test_->CreateRoot(model_type_); | 101 success_ = test_->CreateRoot(model_type_); |
102 } | 102 } |
OLD | NEW |