| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "sync/engine/entity_tracker.h" | 6 #include "sync/engine/entity_tracker.h" |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "sync/internal_api/public/base/model_type.h" | 10 #include "sync/internal_api/public/base/model_type.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 EntityTrackerTest() | 27 EntityTrackerTest() |
| 28 : kServerId("ServerID"), | 28 : kServerId("ServerID"), |
| 29 kClientTag("some.sample.tag"), | 29 kClientTag("some.sample.tag"), |
| 30 kClientTagHash(syncable::GenerateSyncableHash(PREFERENCES, kClientTag)), | 30 kClientTagHash(syncable::GenerateSyncableHash(PREFERENCES, kClientTag)), |
| 31 kCtime(base::Time::UnixEpoch() + base::TimeDelta::FromDays(10)), | 31 kCtime(base::Time::UnixEpoch() + base::TimeDelta::FromDays(10)), |
| 32 kMtime(base::Time::UnixEpoch() + base::TimeDelta::FromDays(20)) { | 32 kMtime(base::Time::UnixEpoch() + base::TimeDelta::FromDays(20)) { |
| 33 specifics.mutable_preference()->set_name(kClientTag); | 33 specifics.mutable_preference()->set_name(kClientTag); |
| 34 specifics.mutable_preference()->set_value("pref.value"); | 34 specifics.mutable_preference()->set_value("pref.value"); |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual ~EntityTrackerTest() {} | 37 ~EntityTrackerTest() override {} |
| 38 | 38 |
| 39 const std::string kServerId; | 39 const std::string kServerId; |
| 40 const std::string kClientTag; | 40 const std::string kClientTag; |
| 41 const std::string kClientTagHash; | 41 const std::string kClientTagHash; |
| 42 const base::Time kCtime; | 42 const base::Time kCtime; |
| 43 const base::Time kMtime; | 43 const base::Time kMtime; |
| 44 sync_pb::EntitySpecifics specifics; | 44 sync_pb::EntitySpecifics specifics; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Construct a new entity from a server update. Then receive another update. | 47 // Construct a new entity from a server update. Then receive another update. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 false, | 154 false, |
| 155 specifics)); | 155 specifics)); |
| 156 | 156 |
| 157 EXPECT_TRUE(entity->IsCommitPending()); | 157 EXPECT_TRUE(entity->IsCommitPending()); |
| 158 | 158 |
| 159 entity->ReceiveUpdate(33); // Version 33 == 33. | 159 entity->ReceiveUpdate(33); // Version 33 == 33. |
| 160 EXPECT_TRUE(entity->IsCommitPending()); | 160 EXPECT_TRUE(entity->IsCommitPending()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace syncer | 163 } // namespace syncer |
| OLD | NEW |