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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 entry.PutUniqueClientTag(hashed_tag); | 192 entry.PutUniqueClientTag(hashed_tag); |
193 entry.PutIsDel(false); | 193 entry.PutIsDel(false); |
194 entry.PutSpecifics(specifics); | 194 entry.PutSpecifics(specifics); |
195 return entry.GetMetahandle(); | 195 return entry.GetMetahandle(); |
196 } | 196 } |
197 | 197 |
198 } // namespace | 198 } // namespace |
199 | 199 |
200 class SyncApiTest : public testing::Test { | 200 class SyncApiTest : public testing::Test { |
201 public: | 201 public: |
202 virtual void SetUp() { | 202 void SetUp() override { test_user_share_.SetUp(); } |
203 test_user_share_.SetUp(); | |
204 } | |
205 | 203 |
206 virtual void TearDown() { | 204 void TearDown() override { test_user_share_.TearDown(); } |
207 test_user_share_.TearDown(); | |
208 } | |
209 | 205 |
210 protected: | 206 protected: |
211 // Create an entry with the given |model_type|, |client_tag| and | 207 // Create an entry with the given |model_type|, |client_tag| and |
212 // |attachment_metadata|. | 208 // |attachment_metadata|. |
213 void CreateEntryWithAttachmentMetadata( | 209 void CreateEntryWithAttachmentMetadata( |
214 const ModelType& model_type, | 210 const ModelType& model_type, |
215 const std::string& client_tag, | 211 const std::string& client_tag, |
216 const sync_pb::AttachmentMetadata& attachment_metadata); | 212 const sync_pb::AttachmentMetadata& attachment_metadata); |
217 | 213 |
218 // Attempts to load the entry specified by |model_type| and |client_tag| and | 214 // Attempts to load the entry specified by |model_type| and |client_tag| and |
(...skipping 2955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3174 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3170 // SyncManagerInitInvalidStorageTest::GetFactory will return |
3175 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3171 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
3176 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3172 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
3177 // task is to ensure that SyncManagerImpl reported initialization failure in | 3173 // task is to ensure that SyncManagerImpl reported initialization failure in |
3178 // OnInitializationComplete callback. | 3174 // OnInitializationComplete callback. |
3179 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3175 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
3180 EXPECT_FALSE(initialization_succeeded_); | 3176 EXPECT_FALSE(initialization_succeeded_); |
3181 } | 3177 } |
3182 | 3178 |
3183 } // namespace syncer | 3179 } // namespace syncer |
OLD | NEW |