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
3 // found in the LICENSE file.
5 #include "sync/internal_api/test/sync_manager_for_profile_sync_test.h"
7 #include "sync/internal_api/public/test/test_user_share.h"
8 #include "sync/internal_api/public/user_share.h"
9 #include "sync/syncable/directory.h"
13 SyncManagerForProfileSyncTest::SyncManagerForProfileSyncTest(
15 base::Closure init_callback
)
16 : SyncManagerImpl(name
),
17 init_callback_(init_callback
) {}
19 SyncManagerForProfileSyncTest::~SyncManagerForProfileSyncTest() {}
21 void SyncManagerForProfileSyncTest::NotifyInitializationSuccess() {
22 UserShare
* user_share
= GetUserShare();
23 syncable::Directory
* directory
= user_share
->directory
.get();
25 if (!init_callback_
.is_null())
28 ModelTypeSet early_download_types
;
29 early_download_types
.PutAll(ControlTypes());
30 early_download_types
.PutAll(PriorityUserTypes());
31 for (ModelTypeSet::Iterator it
= early_download_types
.First();
32 it
.Good(); it
.Inc()) {
33 if (!directory
->InitialSyncEndedForType(it
.Get())) {
34 syncer::TestUserShare::CreateRoot(it
.Get(), user_share
);
38 SyncManagerImpl::NotifyInitializationSuccess();