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

Side by Side Diff: content/browser/fileapi/obfuscated_file_util_unittest.cc

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 weak_factory_(this) {} 160 weak_factory_(this) {}
161 161
162 void SetUp() override { 162 void SetUp() override {
163 ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); 163 ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
164 164
165 storage_policy_ = new MockSpecialStoragePolicy(); 165 storage_policy_ = new MockSpecialStoragePolicy();
166 166
167 quota_manager_ = new storage::QuotaManager( 167 quota_manager_ = new storage::QuotaManager(
168 false /* is_incognito */, data_dir_.GetPath(), 168 false /* is_incognito */, data_dir_.GetPath(),
169 base::ThreadTaskRunnerHandle::Get().get(), 169 base::ThreadTaskRunnerHandle::Get().get(),
170 base::ThreadTaskRunnerHandle::Get().get(), storage_policy_.get(), 170 base::ThreadTaskRunnerHandle::Get().get(), storage_policy_.get());
171 storage::GetQuotaSettingsFunc());
172 storage::QuotaSettings settings;
173 settings.per_host_quota = 25 * 1024 * 1024;
174 settings.pool_size = settings.per_host_quota * 5;
175 settings.must_remain_available = 10 * 1024 * 1024;
176 settings.refresh_interval = base::TimeDelta::Max();
177 quota_manager_->SetQuotaSettings(settings);
178 171
179 // Every time we create a new sandbox_file_system helper, 172 // Every time we create a new sandbox_file_system helper,
180 // it creates another context, which creates another path manager, 173 // it creates another context, which creates another path manager,
181 // another sandbox_backend, and another OFU. 174 // another sandbox_backend, and another OFU.
182 // We need to pass in the context to skip all that. 175 // We need to pass in the context to skip all that.
183 file_system_context_ = CreateFileSystemContextForTesting( 176 file_system_context_ = CreateFileSystemContextForTesting(
184 quota_manager_->proxy(), data_dir_.GetPath()); 177 quota_manager_->proxy(), data_dir_.GetPath());
185 178
186 sandbox_file_system_.SetUp(file_system_context_.get()); 179 sandbox_file_system_.SetUp(file_system_context_.get());
187 180
(...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 ofu()->GetDirectoryForOriginAndType( 2567 ofu()->GetDirectoryForOriginAndType(
2575 origin2, GetTypeString(kFileSystemTypeTemporary), false, &error); 2568 origin2, GetTypeString(kFileSystemTypeTemporary), false, &error);
2576 ASSERT_EQ(base::File::FILE_OK, error); 2569 ASSERT_EQ(base::File::FILE_OK, error);
2577 error = base::File::FILE_ERROR_FAILED; 2570 error = base::File::FILE_ERROR_FAILED;
2578 ofu()->GetDirectoryForOriginAndType( 2571 ofu()->GetDirectoryForOriginAndType(
2579 origin2, GetTypeString(kFileSystemTypePersistent), false, &error); 2572 origin2, GetTypeString(kFileSystemTypePersistent), false, &error);
2580 ASSERT_EQ(base::File::FILE_OK, error); 2573 ASSERT_EQ(base::File::FILE_OK, error);
2581 } 2574 }
2582 2575
2583 } // namespace content 2576 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/file_system_browsertest.cc ('k') | content/browser/indexed_db/indexed_db_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698