OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <map> | 10 #include <map> |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 public: | 224 public: |
225 virtual void SetUp() { | 225 virtual void SetUp() { |
226 test_user_share_.SetUp(); | 226 test_user_share_.SetUp(); |
227 } | 227 } |
228 | 228 |
229 virtual void TearDown() { | 229 virtual void TearDown() { |
230 test_user_share_.TearDown(); | 230 test_user_share_.TearDown(); |
231 } | 231 } |
232 | 232 |
233 protected: | 233 protected: |
234 MessageLoop message_loop_; | 234 base::MessageLoop message_loop_; |
235 TestUserShare test_user_share_; | 235 TestUserShare test_user_share_; |
236 }; | 236 }; |
237 | 237 |
238 TEST_F(SyncApiTest, SanityCheckTest) { | 238 TEST_F(SyncApiTest, SanityCheckTest) { |
239 { | 239 { |
240 ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); | 240 ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); |
241 EXPECT_TRUE(trans.GetWrappedTrans()); | 241 EXPECT_TRUE(trans.GetWrappedTrans()); |
242 } | 242 } |
243 { | 243 { |
244 WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); | 244 WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 sync_manager_.directory()->SetDownloadProgress(type, marker); | 1009 sync_manager_.directory()->SetDownloadProgress(type, marker); |
1010 } | 1010 } |
1011 } | 1011 } |
1012 | 1012 |
1013 InternalComponentsFactory::Switches GetSwitches() const { | 1013 InternalComponentsFactory::Switches GetSwitches() const { |
1014 return switches_; | 1014 return switches_; |
1015 } | 1015 } |
1016 | 1016 |
1017 private: | 1017 private: |
1018 // Needed by |sync_manager_|. | 1018 // Needed by |sync_manager_|. |
1019 MessageLoop message_loop_; | 1019 base::MessageLoop message_loop_; |
1020 // Needed by |sync_manager_|. | 1020 // Needed by |sync_manager_|. |
1021 base::ScopedTempDir temp_dir_; | 1021 base::ScopedTempDir temp_dir_; |
1022 // Sync Id's for the roots of the enabled datatypes. | 1022 // Sync Id's for the roots of the enabled datatypes. |
1023 std::map<ModelType, int64> type_roots_; | 1023 std::map<ModelType, int64> type_roots_; |
1024 FakeExtensionsActivityMonitor extensions_activity_monitor_; | 1024 FakeExtensionsActivityMonitor extensions_activity_monitor_; |
1025 | 1025 |
1026 protected: | 1026 protected: |
1027 FakeEncryptor encryptor_; | 1027 FakeEncryptor encryptor_; |
1028 TestUnrecoverableErrorHandler handler_; | 1028 TestUnrecoverableErrorHandler handler_; |
1029 FakeInvalidator* fake_invalidator_; | 1029 FakeInvalidator* fake_invalidator_; |
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3419 size_t folder_b_pos = | 3419 size_t folder_b_pos = |
3420 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE); | 3420 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE); |
3421 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE); | 3421 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE); |
3422 | 3422 |
3423 // Deletes should appear before updates. | 3423 // Deletes should appear before updates. |
3424 EXPECT_LT(child_pos, folder_a_pos); | 3424 EXPECT_LT(child_pos, folder_a_pos); |
3425 EXPECT_LT(folder_b_pos, folder_a_pos); | 3425 EXPECT_LT(folder_b_pos, folder_a_pos); |
3426 } | 3426 } |
3427 | 3427 |
3428 } // namespace | 3428 } // namespace |
OLD | NEW |