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

Unified Diff: chrome/browser/sync_file_system/local/canned_syncable_file_system.cc

Issue 147843007: [SyncFS] Disable quota management on tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 11 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/sync_file_system/local/canned_syncable_file_system.cc
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
index 6d416f13840be2622bcad186731b15471e88531d..9608013fd2f9f9cf5dd12e247432ce526a6be2ac 100644
--- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
+++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
@@ -222,18 +222,20 @@ CannedSyncableFileSystem::CannedSyncableFileSystem(
CannedSyncableFileSystem::~CannedSyncableFileSystem() {}
-void CannedSyncableFileSystem::SetUp() {
+void CannedSyncableFileSystem::SetUp(QuotaMode quota_mode) {
ASSERT_FALSE(is_filesystem_set_up_);
ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
scoped_refptr<quota::SpecialStoragePolicy> storage_policy =
new quota::MockSpecialStoragePolicy();
- quota_manager_ = new QuotaManager(false /* is_incognito */,
- data_dir_.path(),
- io_task_runner_.get(),
- base::MessageLoopProxy::current().get(),
- storage_policy.get());
+ if (quota_mode == QUOTA_ENABLED) {
+ quota_manager_ = new QuotaManager(false /* is_incognito */,
+ data_dir_.path(),
+ io_task_runner_.get(),
+ base::MessageLoopProxy::current().get(),
+ storage_policy.get());
+ }
std::vector<std::string> additional_allowed_schemes;
additional_allowed_schemes.push_back(origin_.scheme());
@@ -250,7 +252,7 @@ void CannedSyncableFileSystem::SetUp() {
file_task_runner_.get(),
fileapi::ExternalMountPoints::CreateRefCounted().get(),
storage_policy.get(),
- quota_manager_->proxy(),
+ quota_manager_ ? quota_manager_->proxy() : NULL,
additional_backends.Pass(),
data_dir_.path(), options);
@@ -708,6 +710,7 @@ void CannedSyncableFileSystem::DoGetUsageAndQuota(
const quota::StatusCallback& callback) {
EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
EXPECT_TRUE(is_filesystem_opened_);
+ DCHECK(quota_manager_);
quota_manager_->GetUsageAndQuota(
origin_, storage_type(),
base::Bind(&DidGetUsageAndQuota, callback, usage, quota));

Powered by Google App Engine
This is Rietveld 408576698