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
3 // found in the LICENSE file.
5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_
6 #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_
8 #include "sync/internal_api/public/internal_components_factory.h"
13 // BuildDirectoryBackingStore should not use persistent on-disk storage.
15 // Use this if you want BuildDirectoryBackingStore to create a real
18 // Use this to test the case where a directory fails to load.
22 class TestInternalComponentsFactory
: public InternalComponentsFactory
{
24 explicit TestInternalComponentsFactory(const Switches
& switches
,
25 StorageOption option
);
26 virtual ~TestInternalComponentsFactory();
28 virtual scoped_ptr
<SyncScheduler
> BuildScheduler(
29 const std::string
& name
,
30 sessions::SyncSessionContext
* context
,
31 syncer::CancelationSignal
* cancelation_signal
) OVERRIDE
;
33 virtual scoped_ptr
<sessions::SyncSessionContext
> BuildContext(
34 ServerConnectionManager
* connection_manager
,
35 syncable::Directory
* directory
,
36 ExtensionsActivity
* monitor
,
37 const std::vector
<SyncEngineEventListener
*>& listeners
,
38 sessions::DebugInfoGetter
* debug_info_getter
,
39 ModelTypeRegistry
* model_type_registry
,
40 const std::string
& invalidator_client_id
) OVERRIDE
;
42 virtual scoped_ptr
<syncable::DirectoryBackingStore
>
43 BuildDirectoryBackingStore(
44 const std::string
& dir_name
,
45 const base::FilePath
& backing_filepath
) OVERRIDE
;
47 virtual Switches
GetSwitches() const OVERRIDE
;
50 const Switches switches_
;
51 const StorageOption storage_option_
;
53 DISALLOW_COPY_AND_ASSIGN(TestInternalComponentsFactory
);
58 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_INTERNAL_COMPONENTS_FACTORY_H_