| 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" | 
| 11 #include "sync/syncable/syncable_util.h" | 11 #include "sync/syncable/syncable_util.h" | 
| 12 #include "sync/util/time.h" | 12 #include "sync/util/time.h" | 
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" | 
| 14 | 14 | 
| 15 namespace syncer_v2 { | 15 namespace syncer_v2 { | 
| 16 | 16 | 
| 17 // Some simple tests for the EntityTracker. | 17 // Some simple tests for the EntityTracker. | 
| 18 // | 18 // | 
| 19 // The EntityTracker is an implementation detail of the ModelTypeSyncWorker. | 19 // The EntityTracker is an implementation detail of the ModelTypeWorker. | 
| 20 // As such, it doesn't make much sense to test it exhaustively, since it | 20 // As such, it doesn't make much sense to test it exhaustively, since it | 
| 21 // already gets a lot of test coverage from the ModelTypeSyncWorker unit tests. | 21 // already gets a lot of test coverage from the ModelTypeWorker unit tests. | 
| 22 // | 22 // | 
| 23 // These tests are intended as a basic sanity check.  Anything more complicated | 23 // These tests are intended as a basic sanity check.  Anything more complicated | 
| 24 // would be redundant. | 24 // would be redundant. | 
| 25 class EntityTrackerTest : public ::testing::Test { | 25 class EntityTrackerTest : public ::testing::Test { | 
| 26  public: | 26  public: | 
| 27   EntityTrackerTest() | 27   EntityTrackerTest() | 
| 28       : kServerId("ServerID"), | 28       : kServerId("ServerID"), | 
| 29         kClientTag("some.sample.tag"), | 29         kClientTag("some.sample.tag"), | 
| 30         kClientTagHash( | 30         kClientTagHash( | 
| 31             syncer::syncable::GenerateSyncableHash(syncer::PREFERENCES, | 31             syncer::syncable::GenerateSyncableHash(syncer::PREFERENCES, | 
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 156                                        false, | 156                                        false, | 
| 157                                        specifics)); | 157                                        specifics)); | 
| 158 | 158 | 
| 159   EXPECT_TRUE(entity->IsCommitPending()); | 159   EXPECT_TRUE(entity->IsCommitPending()); | 
| 160 | 160 | 
| 161   entity->ReceiveUpdate(33);  // Version 33 == 33. | 161   entity->ReceiveUpdate(33);  // Version 33 == 33. | 
| 162   EXPECT_TRUE(entity->IsCommitPending()); | 162   EXPECT_TRUE(entity->IsCommitPending()); | 
| 163 } | 163 } | 
| 164 | 164 | 
| 165 }  // namespace syncer | 165 }  // namespace syncer | 
| OLD | NEW | 
|---|