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

Unified Diff: components/sync/engine_impl/sync_manager_impl_unittest.cc

Issue 2413313004: [Sync] Move the last things out of core/. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/sync_manager_impl_unittest.cc
diff --git a/components/sync/core_impl/sync_manager_impl_unittest.cc b/components/sync/engine_impl/sync_manager_impl_unittest.cc
similarity index 98%
rename from components/sync/core_impl/sync_manager_impl_unittest.cc
rename to components/sync/engine_impl/sync_manager_impl_unittest.cc
index 1e451fae719781ced9c61db865432af5bd5834ec..d158f1280dc540dc21362f54599603392c5d4890 100644
--- a/components/sync/core_impl/sync_manager_impl_unittest.cc
+++ b/components/sync/engine_impl/sync_manager_impl_unittest.cc
@@ -6,7 +6,7 @@
// functionality is provided by the Syncable layer, which has its own
// unit tests. We'll test SyncApi specific things in this harness.
-#include "components/sync/core_impl/sync_manager_impl.h"
+#include "components/sync/engine_impl/sync_manager_impl.h"
#include <cstddef>
#include <memory>
@@ -29,16 +29,16 @@
#include "components/sync/base/fake_encryptor.h"
#include "components/sync/base/mock_unrecoverable_error_handler.h"
#include "components/sync/base/model_type_test_util.h"
-#include "components/sync/core/test/test_entry_factory.h"
-#include "components/sync/core/test/test_internal_components_factory.h"
-#include "components/sync/core_impl/syncapi_internal.h"
+#include "components/sync/engine/engine_util.h"
#include "components/sync/engine/events/protocol_event.h"
#include "components/sync/engine/model_safe_worker.h"
#include "components/sync/engine/net/http_post_provider_factory.h"
#include "components/sync/engine/net/http_post_provider_interface.h"
#include "components/sync/engine/polling_constants.h"
+#include "components/sync/engine/test_engine_components_factory.h"
#include "components/sync/engine_impl/cycle/sync_cycle.h"
#include "components/sync/engine_impl/sync_scheduler.h"
+#include "components/sync/engine_impl/test_entry_factory.h"
#include "components/sync/js/js_event_handler.h"
#include "components/sync/js/js_test_util.h"
#include "components/sync/protocol/bookmark_specifics.pb.h"
@@ -941,8 +941,7 @@ class SyncManagerTest : public testing::Test,
enum EncryptionStatus { UNINITIALIZED, DEFAULT_ENCRYPTION, FULL_ENCRYPTION };
SyncManagerTest() : sync_manager_("Test sync manager") {
- switches_.encryption_method =
- InternalComponentsFactory::ENCRYPTION_KEYSTORE;
+ switches_.encryption_method = EngineComponentsFactory::ENCRYPTION_KEYSTORE;
}
virtual ~SyncManagerTest() {}
@@ -988,7 +987,7 @@ class SyncManagerTest : public testing::Test,
args.change_delegate = this;
args.credentials = credentials;
args.invalidator_client_id = "fake_invalidator_client_id";
- args.internal_components_factory.reset(GetFactory());
+ args.engine_components_factory.reset(GetFactory());
args.encryptor = &encryptor_;
args.unrecoverable_error_handler =
MakeWeakHandle(mock_unrecoverable_error_handler_.GetWeakPtr());
@@ -998,7 +997,7 @@ class SyncManagerTest : public testing::Test,
sync_manager_.GetEncryptionHandler()->AddObserver(&encryption_observer_);
EXPECT_TRUE(js_backend_.IsInitialized());
- EXPECT_EQ(InternalComponentsFactory::STORAGE_ON_DISK, storage_used_);
+ EXPECT_EQ(EngineComponentsFactory::STORAGE_ON_DISK, storage_used_);
if (initialization_succeeded_) {
for (ModelSafeRoutingInfo::iterator i = routing_info.begin();
@@ -1108,9 +1107,9 @@ class SyncManagerTest : public testing::Test,
return true;
}
- virtual InternalComponentsFactory* GetFactory() {
- return new TestInternalComponentsFactory(
- GetSwitches(), InternalComponentsFactory::STORAGE_IN_MEMORY,
+ virtual EngineComponentsFactory* GetFactory() {
+ return new TestEngineComponentsFactory(
+ GetSwitches(), EngineComponentsFactory::STORAGE_IN_MEMORY,
&storage_used_);
}
@@ -1159,7 +1158,7 @@ class SyncManagerTest : public testing::Test,
}
}
- InternalComponentsFactory::Switches GetSwitches() const { return switches_; }
+ EngineComponentsFactory::Switches GetSwitches() const { return switches_; }
void ExpectPassphraseAcceptance() {
EXPECT_CALL(encryption_observer_, OnPassphraseAccepted());
@@ -1202,8 +1201,8 @@ class SyncManagerTest : public testing::Test,
bool initialization_succeeded_;
StrictMock<SyncManagerObserverMock> manager_observer_;
StrictMock<SyncEncryptionHandlerObserverMock> encryption_observer_;
- InternalComponentsFactory::Switches switches_;
- InternalComponentsFactory::StorageOption storage_used_;
+ EngineComponentsFactory::Switches switches_;
+ EngineComponentsFactory::StorageOption storage_used_;
MockUnrecoverableErrorHandler mock_unrecoverable_error_handler_;
};
@@ -2542,16 +2541,15 @@ class MockSyncScheduler : public FakeSyncScheduler {
MOCK_METHOD1(ScheduleConfiguration, void(const ConfigurationParams&));
};
-class ComponentsFactory : public TestInternalComponentsFactory {
+class ComponentsFactory : public TestEngineComponentsFactory {
public:
ComponentsFactory(const Switches& switches,
SyncScheduler* scheduler_to_use,
SyncCycleContext** cycle_context,
- InternalComponentsFactory::StorageOption* storage_used)
- : TestInternalComponentsFactory(
- switches,
- InternalComponentsFactory::STORAGE_IN_MEMORY,
- storage_used),
+ EngineComponentsFactory::StorageOption* storage_used)
+ : TestEngineComponentsFactory(switches,
+ EngineComponentsFactory::STORAGE_IN_MEMORY,
+ storage_used),
scheduler_to_use_(scheduler_to_use),
cycle_context_(cycle_context) {}
~ComponentsFactory() override {}
@@ -2572,7 +2570,7 @@ class ComponentsFactory : public TestInternalComponentsFactory {
class SyncManagerTestWithMockScheduler : public SyncManagerTest {
public:
SyncManagerTestWithMockScheduler() : scheduler_(NULL) {}
- InternalComponentsFactory* GetFactory() override {
+ EngineComponentsFactory* GetFactory() override {
scheduler_ = new MockSyncScheduler();
return new ComponentsFactory(GetSwitches(), scheduler_, &cycle_context_,
&storage_used_);
@@ -3336,15 +3334,15 @@ TEST_F(SyncManagerChangeProcessingTest, AttachmentMetadataOnlyChanges) {
// During initialization SyncManagerImpl loads sqlite database. If it fails to
// do so it should fail initialization. This test verifies this behavior.
// Test reuses SyncManagerImpl initialization from SyncManagerTest but overrides
-// InternalComponentsFactory to return DirectoryBackingStore that always fails
+// EngineComponentsFactory to return DirectoryBackingStore that always fails
// to load.
class SyncManagerInitInvalidStorageTest : public SyncManagerTest {
public:
SyncManagerInitInvalidStorageTest() {}
- InternalComponentsFactory* GetFactory() override {
- return new TestInternalComponentsFactory(
- GetSwitches(), InternalComponentsFactory::STORAGE_INVALID,
+ EngineComponentsFactory* GetFactory() override {
+ return new TestEngineComponentsFactory(
+ GetSwitches(), EngineComponentsFactory::STORAGE_INVALID,
&storage_used_);
}
};
« no previous file with comments | « components/sync/engine_impl/sync_manager_impl.cc ('k') | components/sync/engine_impl/syncer_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698