OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/engine/syncer_util.h" | 5 #include "sync/engine/syncer_util.h" |
6 | 6 |
7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
8 #include "sync/internal_api/public/base/unique_position.h" | 8 #include "sync/internal_api/public/base/unique_position.h" |
9 #include "sync/internal_api/public/test/test_entry_factory.h" | 9 #include "sync/internal_api/public/test/test_entry_factory.h" |
10 #include "sync/protocol/sync.pb.h" | 10 #include "sync/protocol/sync.pb.h" |
11 #include "sync/syncable/mutable_entry.h" | 11 #include "sync/syncable/mutable_entry.h" |
12 #include "sync/syncable/syncable_write_transaction.h" | 12 #include "sync/syncable/syncable_write_transaction.h" |
13 #include "sync/test/engine/test_directory_setter_upper.h" | 13 #include "sync/test/engine/test_directory_setter_upper.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace syncer { | 16 namespace syncer { |
17 | 17 |
18 class GetUpdatePositionTest : public ::testing::Test { | 18 class GetUpdatePositionTest : public ::testing::Test { |
19 public: | 19 public: |
20 virtual void SetUp() { | 20 void SetUp() override { |
21 dir_maker_.SetUp(); | 21 dir_maker_.SetUp(); |
22 entry_factory_.reset(new TestEntryFactory(directory())); | 22 entry_factory_.reset(new TestEntryFactory(directory())); |
23 } | 23 } |
24 | 24 |
25 virtual void TearDown() { | 25 void TearDown() override { dir_maker_.TearDown(); } |
26 dir_maker_.TearDown(); | |
27 } | |
28 | 26 |
29 syncable::Directory* directory() { | 27 syncable::Directory* directory() { |
30 return dir_maker_.directory(); | 28 return dir_maker_.directory(); |
31 } | 29 } |
32 | 30 |
33 TestEntryFactory* entry_factory() { | 31 TestEntryFactory* entry_factory() { |
34 return entry_factory_.get(); | 32 return entry_factory_.get(); |
35 } | 33 } |
36 | 34 |
37 GetUpdatePositionTest() { | 35 GetUpdatePositionTest() { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 EXPECT_FALSE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); | 195 EXPECT_FALSE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); |
198 EXPECT_FALSE(target.GetServerUniquePosition().IsValid()); | 196 EXPECT_FALSE(target.GetServerUniquePosition().IsValid()); |
199 UpdateServerFieldsFromUpdate(&target, update, "name"); | 197 UpdateServerFieldsFromUpdate(&target, update, "name"); |
200 | 198 |
201 // After update, target has valid bookmark tag and unique position. | 199 // After update, target has valid bookmark tag and unique position. |
202 EXPECT_TRUE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); | 200 EXPECT_TRUE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); |
203 EXPECT_TRUE(target.GetServerUniquePosition().IsValid()); | 201 EXPECT_TRUE(target.GetServerUniquePosition().IsValid()); |
204 } | 202 } |
205 | 203 |
206 } // namespace syncer | 204 } // namespace syncer |
OLD | NEW |