| Index: components/sync/model_impl/processor_entity_tracker_unittest.cc
|
| diff --git a/components/sync/model_impl/processor_entity_tracker_unittest.cc b/components/sync/model_impl/processor_entity_tracker_unittest.cc
|
| index e23b9f581eacbdcb8d510a3e906e029a0ab949fb..e79e2850db989cc9211de88b952388155801dc02 100644
|
| --- a/components/sync/model_impl/processor_entity_tracker_unittest.cc
|
| +++ b/components/sync/model_impl/processor_entity_tracker_unittest.cc
|
| @@ -107,6 +107,9 @@ class ProcessorEntityTrackerTest : public ::testing::Test {
|
| std::unique_ptr<ProcessorEntityTracker> CreateNew() {
|
| return ProcessorEntityTracker::CreateNew(kKey, kHash, "", ctime_);
|
| }
|
| + std::unique_ptr<ProcessorEntityTracker> CreateNewWithEmptyStorageKey() {
|
| + return ProcessorEntityTracker::CreateNew("", kHash, "", ctime_);
|
| + }
|
|
|
| std::unique_ptr<ProcessorEntityTracker> CreateSynced() {
|
| std::unique_ptr<ProcessorEntityTracker> entity = CreateNew();
|
| @@ -242,6 +245,21 @@ TEST_F(ProcessorEntityTrackerTest, NewServerItem) {
|
| EXPECT_FALSE(entity->HasCommitData());
|
| }
|
|
|
| +// Test creating tracker for new server item with empty storage key, applying
|
| +// update and updating storage key.
|
| +TEST_F(ProcessorEntityTrackerTest, NewServerItem_EmptyStorageKey) {
|
| + std::unique_ptr<ProcessorEntityTracker> entity =
|
| + CreateNewWithEmptyStorageKey();
|
| +
|
| + EXPECT_EQ("", entity->storage_key());
|
| +
|
| + const base::Time mtime = base::Time::Now();
|
| + entity->RecordAcceptedUpdate(
|
| + GenerateUpdate(*entity, kHash, kId, kName, kValue1, mtime, 10));
|
| + entity->SetStorageKey(kKey);
|
| + EXPECT_EQ(kKey, entity->storage_key());
|
| +}
|
| +
|
| // Test state for a tombstone received for a previously unknown item.
|
| TEST_F(ProcessorEntityTrackerTest, NewServerTombstone) {
|
| std::unique_ptr<ProcessorEntityTracker> entity = CreateNew();
|
|
|