Index: chrome/test/sync/engine/test_directory_setter_upper.h |
=================================================================== |
--- chrome/test/sync/engine/test_directory_setter_upper.h (revision 27087) |
+++ chrome/test/sync/engine/test_directory_setter_upper.h (working copy) |
@@ -44,20 +44,23 @@ |
class TestDirectorySetterUpper { |
public: |
TestDirectorySetterUpper(); |
- ~TestDirectorySetterUpper(); |
+ virtual ~TestDirectorySetterUpper(); |
// Create a DirectoryManager instance and use it to open the directory. |
// Clears any existing database backing files that might exist on disk. |
- void SetUp(); |
+ virtual void SetUp(); |
// Undo everything done by SetUp(): close the directory and delete the |
// backing files. Before closing the directory, this will run the directory |
// invariant checks and perform the SaveChanges action on the directory. |
- void TearDown(); |
+ virtual void TearDown(); |
syncable::DirectoryManager* manager() const { return manager_.get(); } |
const PathString& name() const { return name_; } |
+ protected: |
+ virtual void Init(); |
+ |
private: |
void RunInvariantCheck(const syncable::ScopedDirLookup& dir); |
@@ -66,6 +69,19 @@ |
PathString file_path_; |
}; |
+// A variant of the above where SetUp does not actually open the directory. |
+// You must manually invoke Open(). This is useful if you are writing a test |
+// that depends on the DirectoryManager::OPENED event. |
+class ManuallyOpenedTestDirectorySetterUpper : public TestDirectorySetterUpper { |
+ public: |
+ ManuallyOpenedTestDirectorySetterUpper() : was_opened_(false) {} |
+ virtual void SetUp(); |
+ virtual void TearDown(); |
+ void Open(); |
+ private: |
+ bool was_opened_; |
+}; |
+ |
} // namespace browser_sync |
#endif // CHROME_TEST_SYNC_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_ |