Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3898)

Unified Diff: chrome/test/sync/engine/test_directory_setter_upper.h

Issue 214033: Use chrome/base synchronization primitives and threads instead of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « chrome/test/sync/engine/mock_server_connection.cc ('k') | chrome/test/sync/engine/test_directory_setter_upper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698