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

Unified Diff: components/sync/driver/data_type_manager_impl_unittest.cc

Issue 2612323003: [Sync] Filter out types that can't be synced at configure time. (Closed)
Patch Set: Fix bots. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/driver/data_type_manager_impl.cc ('k') | components/sync/driver/fake_sync_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/data_type_manager_impl_unittest.cc
diff --git a/components/sync/driver/data_type_manager_impl_unittest.cc b/components/sync/driver/data_type_manager_impl_unittest.cc
index 039443fca303c882ad430db60442119debfb314f..b1d450ae6a575646dd9f15f66fdced70c3791314 100644
--- a/components/sync/driver/data_type_manager_impl_unittest.cc
+++ b/components/sync/driver/data_type_manager_impl_unittest.cc
@@ -14,6 +14,7 @@
#include "components/sync/driver/data_type_manager_observer.h"
#include "components/sync/driver/data_type_status_table.h"
#include "components/sync/driver/fake_data_type_controller.h"
+#include "components/sync/driver/fake_sync_client.h"
#include "components/sync/engine/activation_context.h"
#include "components/sync/engine/configure_reason.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -60,6 +61,11 @@ DataTypeStatusTable BuildStatusTable(ModelTypeSet crypto_errors,
return status_table;
}
+class TestSyncClient : public FakeSyncClient {
+ public:
+ bool HasPasswordStore() override { return true; }
+};
+
// Fake ModelTypeConfigurer implementation that simply stores away the
// callback passed into ConfigureDataTypes.
class FakeModelTypeConfigurer : public ModelTypeConfigurer {
@@ -216,20 +222,7 @@ ModelTypeSet FakeDataTypeEncryptionHandler::GetEncryptedDataTypes() const {
class TestDataTypeManager : public DataTypeManagerImpl {
public:
- TestDataTypeManager(
- ModelTypeSet initial_types,
- const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener,
- ModelTypeConfigurer* configurer,
- const DataTypeController::TypeMap* controllers,
- const DataTypeEncryptionHandler* encryption_handler,
- DataTypeManagerObserver* observer)
- : DataTypeManagerImpl(initial_types,
- debug_info_listener,
- controllers,
- encryption_handler,
- configurer,
- observer),
- custom_priority_types_(ControlTypes()) {}
+ using DataTypeManagerImpl::DataTypeManagerImpl;
void set_priority_types(const ModelTypeSet& priority_types) {
custom_priority_types_ = priority_types;
@@ -250,7 +243,7 @@ class TestDataTypeManager : public DataTypeManagerImpl {
return custom_priority_types_;
}
- ModelTypeSet custom_priority_types_;
+ ModelTypeSet custom_priority_types_ = ControlTypes();
DataTypeManager::ConfigureResult configure_result_;
};
@@ -265,8 +258,8 @@ class SyncDataTypeManagerImplTest : public testing::Test {
protected:
void SetUp() override {
dtm_ = base::MakeUnique<TestDataTypeManager>(
- ModelTypeSet(), WeakHandle<DataTypeDebugInfoListener>(), &configurer_,
- &controllers_, &encryption_handler_, &observer_);
+ &sync_client_, ModelTypeSet(), WeakHandle<DataTypeDebugInfoListener>(),
+ &controllers_, &encryption_handler_, &configurer_, &observer_);
}
void SetConfigureStartExpectation() { observer_.ExpectStart(); }
@@ -333,6 +326,7 @@ class SyncDataTypeManagerImplTest : public testing::Test {
base::MessageLoopForUI ui_loop_;
DataTypeController::TypeMap controllers_;
+ TestSyncClient sync_client_;
FakeModelTypeConfigurer configurer_;
FakeDataTypeManagerObserver observer_;
std::unique_ptr<TestDataTypeManager> dtm_;
« no previous file with comments | « components/sync/driver/data_type_manager_impl.cc ('k') | components/sync/driver/fake_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698