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

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

Issue 2718533003: [Sync] Adjust types to configure during shutdown (Closed)
Patch Set: Add syncer unittest Created 3 years, 10 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/engine_impl/syncer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/syncer_unittest.cc
diff --git a/components/sync/engine_impl/syncer_unittest.cc b/components/sync/engine_impl/syncer_unittest.cc
index a66b78498b3a520ea1c006db85b28e1f93b012de..ca131a0e7db6102c1fbd2b5da1b383a33ad98b38 100644
--- a/components/sync/engine_impl/syncer_unittest.cc
+++ b/components/sync/engine_impl/syncer_unittest.cc
@@ -251,10 +251,13 @@ class SyncerTest : public testing::Test,
}
bool SyncShareConfigure() {
+ return SyncShareConfigureTypes(context_->GetEnabledTypes());
+ }
+
+ bool SyncShareConfigureTypes(ModelTypeSet types) {
ResetCycle();
return syncer_->ConfigureSyncShare(
- context_->GetEnabledTypes(),
- sync_pb::GetUpdatesCallerInfo::RECONFIGURATION, cycle_.get());
+ types, sync_pb::GetUpdatesCallerInfo::RECONFIGURATION, cycle_.get());
}
void SetUp() override {
@@ -5019,6 +5022,19 @@ TEST_F(SyncerTest, ConfigureFailsDontApplyUpdates) {
mock_server_->ClearUpdatesQueue();
}
+// Tests that, after shutdown initiated, if set of types to download includes
+// unregistered type, DCHECK doesn't get triggered.
+TEST_F(SyncerTest, ConfigureUnregisteredTypesDuringShutdown) {
+ // Signal that shutdown is initiated.
+ cancelation_signal_.Signal();
+
+ // Simulate type being unregistered before configuration by including type
+ // that isn't registered with ModelTypeRegistry.
+ SyncShareConfigureTypes(ModelTypeSet(APPS));
+
+ // No explicit verification, DCHECK shouldn't have been triggered.
+}
+
TEST_F(SyncerTest, GetKeySuccess) {
{
syncable::ReadTransaction rtrans(FROM_HERE, directory());
« no previous file with comments | « components/sync/engine_impl/syncer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698