| 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 // A handy class that takes care of setting up and destroying a | 5 // A handy class that takes care of setting up and destroying a |
| 6 // syncable::Directory instance for unit tests that require one. | 6 // syncable::Directory instance for unit tests that require one. |
| 7 // | 7 // |
| 8 // The expected usage is to make this a component of your test fixture: | 8 // The expected usage is to make this a component of your test fixture: |
| 9 // | 9 // |
| 10 // class AwesomenessTest : public testing::Test { | 10 // class AwesomenessTest : public testing::Test { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class TestDirectorySetterUpper { | 50 class TestDirectorySetterUpper { |
| 51 public: | 51 public: |
| 52 TestDirectorySetterUpper(); | 52 TestDirectorySetterUpper(); |
| 53 virtual ~TestDirectorySetterUpper(); | 53 virtual ~TestDirectorySetterUpper(); |
| 54 | 54 |
| 55 // Create a Directory instance open it. | 55 // Create a Directory instance open it. |
| 56 virtual void SetUp(); | 56 virtual void SetUp(); |
| 57 | 57 |
| 58 // Create a Directory instance using |directory_store| as backend storage. | 58 // Create a Directory instance using |directory_store| as backend storage. |
| 59 // Takes ownership of |directory_store|. | 59 // Takes ownership of |directory_store|. |
| 60 virtual void SetUpWith( | 60 virtual void SetUpWith(syncable::DirectoryBackingStore* directory_store); |
| 61 syncer::syncable::DirectoryBackingStore* directory_store); | |
| 62 | 61 |
| 63 // Undo everything done by SetUp(): close the directory and delete the | 62 // Undo everything done by SetUp(): close the directory and delete the |
| 64 // backing files. Before closing the directory, this will run the directory | 63 // backing files. Before closing the directory, this will run the directory |
| 65 // invariant checks and perform the SaveChanges action on the directory. | 64 // invariant checks and perform the SaveChanges action on the directory. |
| 66 virtual void TearDown(); | 65 virtual void TearDown(); |
| 67 | 66 |
| 68 syncable::Directory* directory() { return directory_.get(); } | 67 syncable::Directory* directory() { return directory_.get(); } |
| 69 | 68 |
| 70 SyncEncryptionHandler* encryption_handler() { return &encryption_handler_; } | 69 SyncEncryptionHandler* encryption_handler() { return &encryption_handler_; } |
| 71 | 70 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 83 FakeSyncEncryptionHandler encryption_handler_; | 82 FakeSyncEncryptionHandler encryption_handler_; |
| 84 std::unique_ptr<syncable::Directory> directory_; | 83 std::unique_ptr<syncable::Directory> directory_; |
| 85 std::string name_; | 84 std::string name_; |
| 86 | 85 |
| 87 DISALLOW_COPY_AND_ASSIGN(TestDirectorySetterUpper); | 86 DISALLOW_COPY_AND_ASSIGN(TestDirectorySetterUpper); |
| 88 }; | 87 }; |
| 89 | 88 |
| 90 } // namespace syncer | 89 } // namespace syncer |
| 91 | 90 |
| 92 #endif // COMPONENTS_SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ | 91 #endif // COMPONENTS_SYNC_TEST_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ |
| OLD | NEW |