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 // Syncer unit tests. Unfortunately a lot of these tests | 5 // Syncer unit tests. Unfortunately a lot of these tests |
6 // are outdated and need to be reworked and updated. | 6 // are outdated and need to be reworked and updated. |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 void SyncShareConfigure() { | 272 void SyncShareConfigure() { |
273 ResetSession(); | 273 ResetSession(); |
274 EXPECT_TRUE(syncer_->ConfigureSyncShare( | 274 EXPECT_TRUE(syncer_->ConfigureSyncShare( |
275 context_->GetEnabledTypes(), | 275 context_->GetEnabledTypes(), |
276 sync_pb::GetUpdatesCallerInfo::RECONFIGURATION, | 276 sync_pb::GetUpdatesCallerInfo::RECONFIGURATION, |
277 session_.get())); | 277 session_.get())); |
278 } | 278 } |
279 | 279 |
280 virtual void SetUp() { | 280 void SetUp() override { |
281 dir_maker_.SetUp(); | 281 dir_maker_.SetUp(); |
282 mock_server_.reset(new MockConnectionManager(directory(), | 282 mock_server_.reset(new MockConnectionManager(directory(), |
283 &cancelation_signal_)); | 283 &cancelation_signal_)); |
284 debug_info_getter_.reset(new MockDebugInfoGetter); | 284 debug_info_getter_.reset(new MockDebugInfoGetter); |
285 EnableDatatype(BOOKMARKS); | 285 EnableDatatype(BOOKMARKS); |
286 EnableDatatype(NIGORI); | 286 EnableDatatype(NIGORI); |
287 EnableDatatype(PREFERENCES); | 287 EnableDatatype(PREFERENCES); |
288 EnableDatatype(NIGORI); | 288 EnableDatatype(NIGORI); |
289 workers_.push_back(scoped_refptr<ModelSafeWorker>( | 289 workers_.push_back(scoped_refptr<ModelSafeWorker>( |
290 new FakeModelWorker(GROUP_PASSIVE))); | 290 new FakeModelWorker(GROUP_PASSIVE))); |
(...skipping 26 matching lines...) Expand all Loading... |
317 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); | 317 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); |
318 ASSERT_EQ(0u, children.size()); | 318 ASSERT_EQ(0u, children.size()); |
319 saw_syncer_event_ = false; | 319 saw_syncer_event_ = false; |
320 root_id_ = TestIdFactory::root(); | 320 root_id_ = TestIdFactory::root(); |
321 parent_id_ = ids_.MakeServer("parent id"); | 321 parent_id_ = ids_.MakeServer("parent id"); |
322 child_id_ = ids_.MakeServer("child id"); | 322 child_id_ = ids_.MakeServer("child id"); |
323 directory()->set_store_birthday(mock_server_->store_birthday()); | 323 directory()->set_store_birthday(mock_server_->store_birthday()); |
324 mock_server_->SetKeystoreKey("encryption_key"); | 324 mock_server_->SetKeystoreKey("encryption_key"); |
325 } | 325 } |
326 | 326 |
327 virtual void TearDown() { | 327 void TearDown() override { |
328 model_type_registry_->UnregisterDirectoryTypeDebugInfoObserver( | 328 model_type_registry_->UnregisterDirectoryTypeDebugInfoObserver( |
329 &debug_info_cache_); | 329 &debug_info_cache_); |
330 mock_server_.reset(); | 330 mock_server_.reset(); |
331 delete syncer_; | 331 delete syncer_; |
332 syncer_ = NULL; | 332 syncer_ = NULL; |
333 dir_maker_.TearDown(); | 333 dir_maker_.TearDown(); |
334 } | 334 } |
335 | 335 |
336 void WriteTestDataToEntry(WriteTransaction* trans, MutableEntry* entry) { | 336 void WriteTestDataToEntry(WriteTransaction* trans, MutableEntry* entry) { |
337 EXPECT_FALSE(entry->GetIsDir()); | 337 EXPECT_FALSE(entry->GetIsDir()); |
(...skipping 4946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5284 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 5284 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
5285 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 5285 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
5286 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 5286 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
5287 } else { | 5287 } else { |
5288 EXPECT_TRUE(final_monitor_records.empty()) | 5288 EXPECT_TRUE(final_monitor_records.empty()) |
5289 << "Should not restore records after successful bookmark commit."; | 5289 << "Should not restore records after successful bookmark commit."; |
5290 } | 5290 } |
5291 } | 5291 } |
5292 | 5292 |
5293 } // namespace syncer | 5293 } // namespace syncer |
OLD | NEW |