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 "components/sync/engine_impl/syncer_util.h" | 5 #include "components/sync/engine_impl/syncer_util.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
| 9 #include "base/memory/ptr_util.h" |
9 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
10 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
11 #include "components/sync/base/unique_position.h" | 12 #include "components/sync/base/unique_position.h" |
12 #include "components/sync/engine_impl/test_entry_factory.h" | 13 #include "components/sync/engine_impl/test_entry_factory.h" |
13 #include "components/sync/protocol/sync.pb.h" | 14 #include "components/sync/protocol/sync.pb.h" |
14 #include "components/sync/syncable/syncable_write_transaction.h" | 15 #include "components/sync/syncable/syncable_write_transaction.h" |
15 #include "components/sync/test/engine/test_directory_setter_upper.h" | 16 #include "components/sync/test/engine/test_directory_setter_upper.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 namespace syncer { | 19 namespace syncer { |
19 | 20 |
20 class GetUpdatePositionTest : public ::testing::Test { | 21 class GetUpdatePositionTest : public ::testing::Test { |
21 public: | 22 public: |
22 void SetUp() override { | 23 void SetUp() override { |
23 dir_maker_.SetUp(); | 24 dir_maker_.SetUp(); |
24 entry_factory_.reset(new TestEntryFactory(directory())); | 25 entry_factory_ = base::MakeUnique<TestEntryFactory>(directory()); |
25 } | 26 } |
26 | 27 |
27 void TearDown() override { dir_maker_.TearDown(); } | 28 void TearDown() override { dir_maker_.TearDown(); } |
28 | 29 |
29 syncable::Directory* directory() { return dir_maker_.directory(); } | 30 syncable::Directory* directory() { return dir_maker_.directory(); } |
30 | 31 |
31 TestEntryFactory* entry_factory() { return entry_factory_.get(); } | 32 TestEntryFactory* entry_factory() { return entry_factory_.get(); } |
32 | 33 |
33 GetUpdatePositionTest() { | 34 GetUpdatePositionTest() { |
34 InitUpdate(); | 35 InitUpdate(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 EXPECT_FALSE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); | 220 EXPECT_FALSE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); |
220 EXPECT_FALSE(target.GetServerUniquePosition().IsValid()); | 221 EXPECT_FALSE(target.GetServerUniquePosition().IsValid()); |
221 UpdateServerFieldsFromUpdate(&target, invalid_update, "name"); | 222 UpdateServerFieldsFromUpdate(&target, invalid_update, "name"); |
222 | 223 |
223 // After update, target has valid bookmark tag and unique position. | 224 // After update, target has valid bookmark tag and unique position. |
224 EXPECT_TRUE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); | 225 EXPECT_TRUE(UniquePosition::IsValidSuffix(target.GetUniqueBookmarkTag())); |
225 EXPECT_TRUE(target.GetServerUniquePosition().IsValid()); | 226 EXPECT_TRUE(target.GetServerUniquePosition().IsValid()); |
226 } | 227 } |
227 | 228 |
228 } // namespace syncer | 229 } // namespace syncer |
OLD | NEW |