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

Unified Diff: content/browser/fileapi/file_system_browsertest.cc

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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: content/browser/fileapi/file_system_browsertest.cc
diff --git a/content/browser/fileapi/file_system_browsertest.cc b/content/browser/fileapi/file_system_browsertest.cc
index ed7fa379666a60dd7dbff4bf9dadee79c3aba5d0..1bc55e7407b6c9fdd78d0d0983c618a22d1796bc 100644
--- a/content/browser/fileapi/file_system_browsertest.cc
+++ b/content/browser/fileapi/file_system_browsertest.cc
@@ -55,27 +55,29 @@ class FileSystemBrowserTest : public ContentBrowserTest {
class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest {
public:
void SetUpOnMainThread() override {
- SetLowQuota(BrowserContext::GetDefaultStoragePartition(
- shell()->web_contents()->GetBrowserContext())
- ->GetQuotaManager());
+ const int kInitialQuotaKilobytes = 5000;
+ const int kTemporaryStorageQuotaMaxSize =
+ kInitialQuotaKilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion;
+ SetTempQuota(
+ kTemporaryStorageQuotaMaxSize,
+ BrowserContext::GetDefaultStoragePartition(
+ shell()->web_contents()->GetBrowserContext())->GetQuotaManager());
}
- static void SetLowQuota(scoped_refptr<QuotaManager> qm) {
+ static void SetTempQuota(int64_t bytes, scoped_refptr<QuotaManager> qm) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&FileSystemBrowserTestWithLowQuota::SetLowQuota, qm));
+ base::Bind(&FileSystemBrowserTestWithLowQuota::SetTempQuota, bytes,
+ qm));
return;
}
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- // These sizes must correspond with expectations in html and js.
- const int kMeg = 1000 * 1024;
- storage::QuotaSettings settings;
- settings.pool_size = 25 * kMeg;
- settings.per_host_quota = 5 * kMeg;
- settings.must_remain_available = 100 * kMeg;
- settings.refresh_interval = base::TimeDelta::Max();
- qm->SetQuotaSettings(settings);
+ qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback());
+ // Don't return until the quota has been set.
+ scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB).get()));
+ ASSERT_TRUE(helper->Run());
}
};
« no previous file with comments | « content/browser/database_tracker_unittest.cc ('k') | content/browser/fileapi/obfuscated_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698