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/directory_commit_contribution.h" | 5 #include "sync/engine/directory_commit_contribution.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "sync/internal_api/public/base/attachment_id_proto.h" | 8 #include "sync/internal_api/public/base/attachment_id_proto.h" |
9 #include "sync/sessions/status_controller.h" | 9 #include "sync/sessions/status_controller.h" |
10 #include "sync/syncable/entry.h" | 10 #include "sync/syncable/entry.h" |
11 #include "sync/syncable/mutable_entry.h" | 11 #include "sync/syncable/mutable_entry.h" |
12 #include "sync/syncable/syncable_read_transaction.h" | 12 #include "sync/syncable/syncable_read_transaction.h" |
13 #include "sync/syncable/syncable_write_transaction.h" | 13 #include "sync/syncable/syncable_write_transaction.h" |
14 #include "sync/test/engine/test_directory_setter_upper.h" | 14 #include "sync/test/engine/test_directory_setter_upper.h" |
15 #include "sync/test/engine/test_id_factory.h" | 15 #include "sync/test/engine/test_id_factory.h" |
16 #include "sync/test/engine/test_syncable_utils.h" | 16 #include "sync/test/engine/test_syncable_utils.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace syncer { | 19 namespace syncer { |
20 | 20 |
21 class DirectoryCommitContributionTest : public ::testing::Test { | 21 class DirectoryCommitContributionTest : public ::testing::Test { |
22 public: | 22 public: |
23 virtual void SetUp() OVERRIDE { | 23 virtual void SetUp() override { |
24 dir_maker_.SetUp(); | 24 dir_maker_.SetUp(); |
25 | 25 |
26 syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); | 26 syncable::WriteTransaction trans(FROM_HERE, syncable::UNITTEST, dir()); |
27 CreateTypeRoot(&trans, dir(), PREFERENCES); | 27 CreateTypeRoot(&trans, dir(), PREFERENCES); |
28 CreateTypeRoot(&trans, dir(), EXTENSIONS); | 28 CreateTypeRoot(&trans, dir(), EXTENSIONS); |
29 CreateTypeRoot(&trans, dir(), ARTICLES); | 29 CreateTypeRoot(&trans, dir(), ARTICLES); |
30 CreateTypeRoot(&trans, dir(), BOOKMARKS); | 30 CreateTypeRoot(&trans, dir(), BOOKMARKS); |
31 } | 31 } |
32 | 32 |
33 virtual void TearDown() OVERRIDE { | 33 virtual void TearDown() override { |
34 dir_maker_.TearDown(); | 34 dir_maker_.TearDown(); |
35 } | 35 } |
36 | 36 |
37 protected: | 37 protected: |
38 int64 CreateUnsyncedItemWithAttachments( | 38 int64 CreateUnsyncedItemWithAttachments( |
39 syncable::WriteTransaction* trans, | 39 syncable::WriteTransaction* trans, |
40 ModelType type, | 40 ModelType type, |
41 const std::string& tag, | 41 const std::string& tag, |
42 const sync_pb::AttachmentMetadata& attachment_metadata) { | 42 const sync_pb::AttachmentMetadata& attachment_metadata) { |
43 syncable::Entry parent_entry(trans, syncable::GET_TYPE_ROOT, type); | 43 syncable::Entry parent_entry(trans, syncable::GET_TYPE_ROOT, type); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 syncable::Entry a3(&trans, syncable::GET_BY_HANDLE, art3_handle); | 495 syncable::Entry a3(&trans, syncable::GET_BY_HANDLE, art3_handle); |
496 EXPECT_FALSE(a3.GetId().ServerKnows()); | 496 EXPECT_FALSE(a3.GetId().ServerKnows()); |
497 EXPECT_FALSE(a3.GetSyncing()); | 497 EXPECT_FALSE(a3.GetSyncing()); |
498 EXPECT_EQ(0, a3.GetServerVersion()); | 498 EXPECT_EQ(0, a3.GetServerVersion()); |
499 } | 499 } |
500 | 500 |
501 art_cc->CleanUp(); | 501 art_cc->CleanUp(); |
502 } | 502 } |
503 | 503 |
504 } // namespace syncer | 504 } // namespace syncer |
OLD | NEW |