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 #ifndef SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ | 5 #ifndef SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ |
6 #define SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ | 6 #define SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // pending changes. This is intended to simulate the recovery from a crash | 79 // pending changes. This is intended to simulate the recovery from a crash |
80 // scenario. The same warnings for SimulateSaveAndReloadDir apply here. | 80 // scenario. The same warnings for SimulateSaveAndReloadDir apply here. |
81 DirOpenResult SimulateCrashAndReloadDir(); | 81 DirOpenResult SimulateCrashAndReloadDir(); |
82 | 82 |
83 void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result); | 83 void GetAllMetaHandles(BaseTransaction* trans, MetahandleSet* result); |
84 void CheckPurgeEntriesWithTypeInSucceeded(ModelTypeSet types_to_purge, | 84 void CheckPurgeEntriesWithTypeInSucceeded(ModelTypeSet types_to_purge, |
85 bool before_reload); | 85 bool before_reload); |
86 bool IsInDirtyMetahandles(int64_t metahandle); | 86 bool IsInDirtyMetahandles(int64_t metahandle); |
87 bool IsInMetahandlesToPurge(int64_t metahandle); | 87 bool IsInMetahandlesToPurge(int64_t metahandle); |
88 | 88 |
89 scoped_ptr<Directory>& dir(); | 89 std::unique_ptr<Directory>& dir(); |
90 DirectoryChangeDelegate* directory_change_delegate(); | 90 DirectoryChangeDelegate* directory_change_delegate(); |
91 Encryptor* encryptor(); | 91 Encryptor* encryptor(); |
92 TestUnrecoverableErrorHandler* unrecoverable_error_handler(); | 92 TestUnrecoverableErrorHandler* unrecoverable_error_handler(); |
93 | 93 |
94 private: | 94 private: |
95 void ValidateEntry(BaseTransaction* trans, | 95 void ValidateEntry(BaseTransaction* trans, |
96 int64_t id, | 96 int64_t id, |
97 bool check_name, | 97 bool check_name, |
98 const std::string& name, | 98 const std::string& name, |
99 int64_t base_version, | 99 int64_t base_version, |
100 int64_t server_version, | 100 int64_t server_version, |
101 bool is_del); | 101 bool is_del); |
102 | 102 |
103 base::MessageLoop message_loop_; | 103 base::MessageLoop message_loop_; |
104 scoped_ptr<Directory> dir_; | 104 std::unique_ptr<Directory> dir_; |
105 NullDirectoryChangeDelegate delegate_; | 105 NullDirectoryChangeDelegate delegate_; |
106 FakeEncryptor encryptor_; | 106 FakeEncryptor encryptor_; |
107 TestUnrecoverableErrorHandler handler_; | 107 TestUnrecoverableErrorHandler handler_; |
108 sql::Connection connection_; | 108 sql::Connection connection_; |
109 }; | 109 }; |
110 | 110 |
111 } // namespace syncable | 111 } // namespace syncable |
112 | 112 |
113 } // namespace syncer | 113 } // namespace syncer |
114 | 114 |
115 #endif // SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ | 115 #endif // SYNC_SYNCABLE_DIRECTORY_UNITTEST_H_ |
OLD | NEW |