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

Unified Diff: chrome/browser/chromeos/gdata/gdata_system_service.h

Issue 10805034: Fix flakiness in RemoteFileSystemExtensionApiTests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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/browser/chromeos/gdata/gdata_system_service.h
diff --git a/chrome/browser/chromeos/gdata/gdata_system_service.h b/chrome/browser/chromeos/gdata/gdata_system_service.h
index ff4e41d8d940c1e3130ccb18dce5c16f2331e69d..711394566acb51abb9e726b7e49975f9bfe8a5dd 100644
--- a/chrome/browser/chromeos/gdata/gdata_system_service.h
+++ b/chrome/browser/chromeos/gdata/gdata_system_service.h
@@ -11,6 +11,8 @@
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/profiles/profile_keyed_service_factory.h"
+class FilePath;
+
namespace gdata {
class DocumentsServiceInterface;
@@ -53,7 +55,8 @@ class GDataSystemService : public ProfileKeyedService {
// Initializes the object. This function should be called before any
// other functions.
- void Initialize(DocumentsServiceInterface* documents_service);
+ void Initialize(DocumentsServiceInterface* documents_service,
+ const FilePath& cache_root);
// Registers remote file system proxy for drive mount point.
void AddDriveMountPoint();
@@ -89,16 +92,15 @@ class GDataSystemServiceFactory : public ProfileKeyedServiceFactory {
// Returns the GDataSystemServiceFactory instance.
static GDataSystemServiceFactory* GetInstance();
- // Just creates a new instance without initializing most of the fields.
- // This is useful for tests such as injecting mocks.
- static ProfileKeyedService* CreateInstance(Profile* profile);
-
- // Returns GDataSystemService for testing, with |documents_service| injected
- // to GDataFileSystem.
- GDataSystemService* GetWithCustomDocumentsServiceForTesting(
- Profile* profile,
+ // Sets documents service that should be used to initialize file system in
+ // test. Should be called before the service is created.
+ static void set_documents_service_for_test(
DocumentsServiceInterface* documents_service);
+ // Sets root path for the cache used in test. Should be called before the
+ // service is created.
+ static void set_cache_root_for_test(const char* cache_root);
satorux1 2012/07/20 17:01:25 let's use a std::string. const std::string&
tbarzic 2012/07/20 18:34:06 Done.
+
private:
friend struct DefaultSingletonTraits<GDataSystemServiceFactory>;
@@ -108,6 +110,9 @@ class GDataSystemServiceFactory : public ProfileKeyedServiceFactory {
// ProfileKeyedServiceFactory:
virtual ProfileKeyedService* BuildServiceInstanceFor(
Profile* profile) const OVERRIDE;
+
+ static DocumentsServiceInterface* test_documents_service_;
+ static const char* test_cache_root_;
satorux1 2012/07/20 17:01:25 static std::string* test_cache_root_ can we just
tbarzic 2012/07/20 18:34:06 Done.
};
} // namespace gdata

Powered by Google App Engine
This is Rietveld 408576698