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

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache.cc

Issue 10830181: Implement initialization for GDataCache to use in-memory metadata for tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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_cache.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.cc b/chrome/browser/chromeos/gdata/gdata_cache.cc
index 6b2efb326d501475a755d3341c40fe6c673eae06..32af36bb8ddacf015e60d388db40fb46876b02c2 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache.cc
@@ -324,7 +324,8 @@ GDataCache::GDataCache(const FilePath& cache_root_path,
: cache_root_path_(cache_root_path),
cache_paths_(GetCachePaths(cache_root_path_)),
blocking_task_runner_(blocking_task_runner),
- weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ force_metadata_map_for_testing_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -748,7 +749,7 @@ void GDataCache::Initialize() {
InitCachePaths(cache_paths_);
metadata_ = GDataCacheMetadata::CreateGDataCacheMetadata(
- blocking_task_runner_).Pass();
+ blocking_task_runner_, force_metadata_map_for_testing_).Pass();
metadata_->Initialize(cache_paths_);
}
@@ -1524,6 +1525,10 @@ void GDataCache::GetCacheEntryHelper(const std::string& resource_id,
*success = GetCacheEntry(resource_id, md5, cache_entry);
}
+void GDataCache::ForceMetadataMapForTesting() {
+ force_metadata_map_for_testing_ = true;
+}
+
// static
FilePath GDataCache::GetCacheRootPath(Profile* profile) {
FilePath cache_base_path;

Powered by Google App Engine
This is Rietveld 408576698