OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "sync/internal_api/test/sync_manager_for_profile_sync_test.h" | 5 #include "components/sync/core_impl/test/sync_manager_for_profile_sync_test.h" |
6 | 6 |
7 #include "sync/internal_api/public/test/test_user_share.h" | 7 #include "components/sync/core/test/test_user_share.h" |
8 #include "sync/internal_api/public/user_share.h" | 8 #include "components/sync/core/user_share.h" |
9 #include "sync/syncable/directory.h" | 9 #include "components/sync/syncable/directory.h" |
10 | 10 |
11 namespace syncer { | 11 namespace syncer { |
12 | 12 |
13 SyncManagerForProfileSyncTest::SyncManagerForProfileSyncTest( | 13 SyncManagerForProfileSyncTest::SyncManagerForProfileSyncTest( |
14 std::string name, | 14 std::string name, |
15 base::Closure init_callback) | 15 base::Closure init_callback) |
16 : SyncManagerImpl(name), | 16 : SyncManagerImpl(name), init_callback_(init_callback) {} |
17 init_callback_(init_callback) {} | |
18 | 17 |
19 SyncManagerForProfileSyncTest::~SyncManagerForProfileSyncTest() {} | 18 SyncManagerForProfileSyncTest::~SyncManagerForProfileSyncTest() {} |
20 | 19 |
21 void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() { | 20 void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() { |
22 UserShare* user_share = GetUserShare(); | 21 UserShare* user_share = GetUserShare(); |
23 syncable::Directory* directory = user_share->directory.get(); | 22 syncable::Directory* directory = user_share->directory.get(); |
24 | 23 |
25 if (!init_callback_.is_null()) | 24 if (!init_callback_.is_null()) |
26 init_callback_.Run(); | 25 init_callback_.Run(); |
27 | 26 |
28 ModelTypeSet early_download_types; | 27 ModelTypeSet early_download_types; |
29 early_download_types.PutAll(ControlTypes()); | 28 early_download_types.PutAll(ControlTypes()); |
30 early_download_types.PutAll(PriorityUserTypes()); | 29 early_download_types.PutAll(PriorityUserTypes()); |
31 for (ModelTypeSet::Iterator it = early_download_types.First(); | 30 for (ModelTypeSet::Iterator it = early_download_types.First(); it.Good(); |
32 it.Good(); it.Inc()) { | 31 it.Inc()) { |
33 if (!directory->InitialSyncEndedForType(it.Get())) { | 32 if (!directory->InitialSyncEndedForType(it.Get())) { |
34 syncer::TestUserShare::CreateRoot(it.Get(), user_share); | 33 syncer::TestUserShare::CreateRoot(it.Get(), user_share); |
35 } | 34 } |
36 } | 35 } |
37 | 36 |
38 SyncManagerImpl::NotifyInitializationSuccess(); | 37 SyncManagerImpl::NotifyInitializationSuccess(); |
39 } | 38 } |
40 | 39 |
41 } // namespace syncer | 40 } // namespace syncer |
OLD | NEW |