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/directory_update_handler.h" | 5 #include "components/sync/engine_impl/directory_update_handler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "components/sync/syncable/syncable_read_transaction.h" | 30 #include "components/sync/syncable/syncable_read_transaction.h" |
31 #include "components/sync/syncable/syncable_write_transaction.h" | 31 #include "components/sync/syncable/syncable_write_transaction.h" |
32 #include "components/sync/test/engine/fake_model_worker.h" | 32 #include "components/sync/test/engine/fake_model_worker.h" |
33 #include "components/sync/test/engine/test_directory_setter_upper.h" | 33 #include "components/sync/test/engine/test_directory_setter_upper.h" |
34 #include "components/sync/test/engine/test_id_factory.h" | 34 #include "components/sync/test/engine/test_id_factory.h" |
35 #include "components/sync/test/engine/test_syncable_utils.h" | 35 #include "components/sync/test/engine/test_syncable_utils.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 36 #include "testing/gtest/include/gtest/gtest.h" |
37 | 37 |
38 namespace syncer { | 38 namespace syncer { |
39 | 39 |
40 using syncable::Id; | 40 using syncer::syncable::Id; |
41 using syncable::UNITTEST; | 41 using syncer::syncable::UNITTEST; |
42 | 42 |
43 static const int64_t kDefaultVersion = 1000; | 43 static const int64_t kDefaultVersion = 1000; |
44 | 44 |
45 // A test harness for tests that focus on processing updates. | 45 // A test harness for tests that focus on processing updates. |
46 // | 46 // |
47 // Update processing is what occurs when we first download updates. It converts | 47 // Update processing is what occurs when we first download updates. It converts |
48 // the received protobuf message into information in the syncable::Directory. | 48 // the received protobuf message into information in the syncable::Directory. |
49 // Any invalid or redundant updates will be dropped at this point. | 49 // Any invalid or redundant updates will be dropped at this point. |
50 class DirectoryUpdateHandlerProcessUpdateTest : public ::testing::Test { | 50 class DirectoryUpdateHandlerProcessUpdateTest : public ::testing::Test { |
51 public: | 51 public: |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 const UpdateCounters& counters = GetArticlesUpdateCounters(); | 1156 const UpdateCounters& counters = GetArticlesUpdateCounters(); |
1157 EXPECT_EQ(1, counters.num_updates_applied); | 1157 EXPECT_EQ(1, counters.num_updates_applied); |
1158 EXPECT_EQ(1, counters.num_local_overwrites); | 1158 EXPECT_EQ(1, counters.num_local_overwrites); |
1159 EXPECT_EQ(0, counters.num_server_overwrites); | 1159 EXPECT_EQ(0, counters.num_server_overwrites); |
1160 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle); | 1160 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle); |
1161 EXPECT_EQ(server_metadata.SerializeAsString(), | 1161 EXPECT_EQ(server_metadata.SerializeAsString(), |
1162 local_metadata.SerializeAsString()); | 1162 local_metadata.SerializeAsString()); |
1163 } | 1163 } |
1164 | 1164 |
1165 } // namespace syncer | 1165 } // namespace syncer |
OLD | NEW |