Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: sync/internal_api/test/test_internal_components_factory.cc

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak in tests Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/sessions/model_type_registry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "sync/internal_api/public/test/test_internal_components_factory.h" 5 #include "sync/internal_api/public/test/test_internal_components_factory.h"
6 6
7 #include "sync/sessions/sync_session_context.h" 7 #include "sync/sessions/sync_session_context.h"
8 #include "sync/syncable/in_memory_directory_backing_store.h" 8 #include "sync/syncable/in_memory_directory_backing_store.h"
9 #include "sync/syncable/on_disk_directory_backing_store.h" 9 #include "sync/syncable/on_disk_directory_backing_store.h"
10 #include "sync/syncable/invalid_directory_backing_store.h" 10 #include "sync/syncable/invalid_directory_backing_store.h"
(...skipping 14 matching lines...) Expand all
25 const std::string& name, 25 const std::string& name,
26 sessions::SyncSessionContext* context, 26 sessions::SyncSessionContext* context,
27 syncer::CancelationSignal* cancelation_signal) { 27 syncer::CancelationSignal* cancelation_signal) {
28 return scoped_ptr<SyncScheduler>(new FakeSyncScheduler()); 28 return scoped_ptr<SyncScheduler>(new FakeSyncScheduler());
29 } 29 }
30 30
31 scoped_ptr<sessions::SyncSessionContext> 31 scoped_ptr<sessions::SyncSessionContext>
32 TestInternalComponentsFactory::BuildContext( 32 TestInternalComponentsFactory::BuildContext(
33 ServerConnectionManager* connection_manager, 33 ServerConnectionManager* connection_manager,
34 syncable::Directory* directory, 34 syncable::Directory* directory,
35 const std::vector<scoped_refptr<ModelSafeWorker> >& workers,
36 ExtensionsActivity* monitor, 35 ExtensionsActivity* monitor,
37 const std::vector<SyncEngineEventListener*>& listeners, 36 const std::vector<SyncEngineEventListener*>& listeners,
38 sessions::DebugInfoGetter* debug_info_getter, 37 sessions::DebugInfoGetter* debug_info_getter,
39 TrafficRecorder* traffic_recorder, 38 TrafficRecorder* traffic_recorder,
39 ModelTypeRegistry* model_type_registry,
40 const std::string& invalidator_client_id) { 40 const std::string& invalidator_client_id) {
41 41
42 // Tests don't wire up listeners. 42 // Tests don't wire up listeners.
43 std::vector<SyncEngineEventListener*> empty_listeners; 43 std::vector<SyncEngineEventListener*> empty_listeners;
44 return scoped_ptr<sessions::SyncSessionContext>( 44 return scoped_ptr<sessions::SyncSessionContext>(
45 new sessions::SyncSessionContext( 45 new sessions::SyncSessionContext(
46 connection_manager, directory, workers, monitor, 46 connection_manager, directory, monitor,
47 empty_listeners, debug_info_getter, 47 empty_listeners, debug_info_getter,
48 traffic_recorder, 48 traffic_recorder,
49 model_type_registry,
49 switches_.encryption_method == ENCRYPTION_KEYSTORE, 50 switches_.encryption_method == ENCRYPTION_KEYSTORE,
50 switches_.pre_commit_updates_policy == 51 switches_.pre_commit_updates_policy ==
51 FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE, 52 FORCE_ENABLE_PRE_COMMIT_UPDATE_AVOIDANCE,
52 invalidator_client_id)); 53 invalidator_client_id));
53 54
54 } 55 }
55 56
56 scoped_ptr<syncable::DirectoryBackingStore> 57 scoped_ptr<syncable::DirectoryBackingStore>
57 TestInternalComponentsFactory::BuildDirectoryBackingStore( 58 TestInternalComponentsFactory::BuildDirectoryBackingStore(
58 const std::string& dir_name, const base::FilePath& backing_filepath) { 59 const std::string& dir_name, const base::FilePath& backing_filepath) {
(...skipping 12 matching lines...) Expand all
71 NOTREACHED(); 72 NOTREACHED();
72 return scoped_ptr<syncable::DirectoryBackingStore>(); 73 return scoped_ptr<syncable::DirectoryBackingStore>();
73 } 74 }
74 75
75 InternalComponentsFactory::Switches 76 InternalComponentsFactory::Switches
76 TestInternalComponentsFactory::GetSwitches() const { 77 TestInternalComponentsFactory::GetSwitches() const {
77 return switches_; 78 return switches_;
78 } 79 }
79 80
80 } // namespace syncer 81 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/sessions/model_type_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698