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

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

Issue 2865022: sync: add CleanupDisabledTypesCommand to purge data pertaining to previously... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 51231)
+++ chrome/test/sync/engine/test_directory_setter_upper.h (working copy)
@@ -34,8 +34,10 @@
#include "base/scoped_ptr.h"
#include "base/scoped_temp_dir.h"
+#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/syncable.h"
#include "chrome/browser/sync/util/sync_types.h"
+#include "testing/gmock/include/gmock/gmock.h"
namespace syncable {
class DirectoryManager;
@@ -65,6 +67,7 @@
// Subclasses may want to use a different directory name.
explicit TestDirectorySetterUpper(const std::string& name);
virtual void Init();
+ void reset_directory_manager(syncable::DirectoryManager* d);
private:
void RunInvariantCheck(const syncable::ScopedDirLookup& dir);
@@ -100,6 +103,33 @@
virtual void TearDown();
};
+// Use this when you don't want to test the whole stack down to the Directory
+// level, as it installs a google mock Directory implementation.
+class MockDirectorySetterUpper : public TestDirectorySetterUpper {
+ public:
+ class Manager : public syncable::DirectoryManager {
+ public:
+ Manager(const FilePath& root_path, syncable::Directory* dir);
+ virtual ~Manager() { managed_directory_ = NULL; }
+ };
+
+ class MockDirectory : public syncable::Directory {
+ public:
+ explicit MockDirectory(const std::string& name);
+ virtual ~MockDirectory() {}
+ MOCK_METHOD1(PurgeEntriesWithTypeIn, void(const syncable::ModelTypeSet&));
+ };
+
+ MockDirectorySetterUpper();
+
+ virtual void SetUp();
+ virtual void TearDown();
+ MockDirectory* directory() { return directory_.get(); }
+
+ private:
+ scoped_ptr<MockDirectory> directory_;
+};
+
} // namespace browser_sync
#endif // CHROME_TEST_SYNC_ENGINE_TEST_DIRECTORY_SETTER_UPPER_H_
« no previous file with comments | « chrome/test/sync/engine/syncer_command_test.h ('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