| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "sync/test/engine/test_directory_setter_upper.h" | 5 #include "sync/test/engine/test_directory_setter_upper.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "sync/syncable/directory.h" | 11 #include "sync/syncable/directory.h" |
| 12 #include "sync/syncable/in_memory_directory_backing_store.h" | 12 #include "sync/syncable/in_memory_directory_backing_store.h" |
| 13 #include "sync/syncable/read_transaction.h" | 13 #include "sync/syncable/read_transaction.h" |
| 14 #include "sync/test/null_transaction_observer.h" | 14 #include "sync/test/null_transaction_observer.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 using syncable::NullTransactionObserver; | 17 using syncable::NullTransactionObserver; |
| 18 using syncable::ReadTransaction; | 18 using syncable::ReadTransaction; |
| 19 | 19 |
| 20 namespace csync { | 20 namespace syncer { |
| 21 | 21 |
| 22 TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {} | 22 TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {} |
| 23 | 23 |
| 24 TestDirectorySetterUpper::~TestDirectorySetterUpper() {} | 24 TestDirectorySetterUpper::~TestDirectorySetterUpper() {} |
| 25 | 25 |
| 26 void TestDirectorySetterUpper::SetUp() { | 26 void TestDirectorySetterUpper::SetUp() { |
| 27 directory_.reset(new syncable::Directory(&encryptor_, &handler_, NULL, | 27 directory_.reset(new syncable::Directory(&encryptor_, &handler_, NULL, |
| 28 new syncable::InMemoryDirectoryBackingStore(name_))); | 28 new syncable::InMemoryDirectoryBackingStore(name_))); |
| 29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 29 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 30 ASSERT_EQ(syncable::OPENED, directory_->Open( | 30 ASSERT_EQ(syncable::OPENED, directory_->Open( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 syncable::ReadTransaction trans(FROM_HERE, directory()); | 52 syncable::ReadTransaction trans(FROM_HERE, directory()); |
| 53 directory()->CheckTreeInvariants(&trans, false); | 53 directory()->CheckTreeInvariants(&trans, false); |
| 54 } | 54 } |
| 55 { | 55 { |
| 56 // Check invariants for all items. | 56 // Check invariants for all items. |
| 57 syncable::ReadTransaction trans(FROM_HERE, directory()); | 57 syncable::ReadTransaction trans(FROM_HERE, directory()); |
| 58 directory()->CheckTreeInvariants(&trans, true); | 58 directory()->CheckTreeInvariants(&trans, true); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace csync | 62 } // namespace syncer |
| OLD | NEW |