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

Unified Diff: content/browser/quota/quota_manager_unittest.cc

Issue 2777183010: [Quota] Lower quota for ephemeral mode (ie. session only) (Closed)
Patch Set: comments Created 3 years, 8 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
« no previous file with comments | « no previous file | storage/browser/quota/quota_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/quota/quota_manager_unittest.cc
diff --git a/content/browser/quota/quota_manager_unittest.cc b/content/browser/quota/quota_manager_unittest.cc
index 396dd0ff2c23c49fc335802f66ae0b79ea5db401..d2b32ed29826a4e0d39d218e555fbb580eadb426 100644
--- a/content/browser/quota/quota_manager_unittest.cc
+++ b/content/browser/quota/quota_manager_unittest.cc
@@ -168,6 +168,8 @@ class QuotaManagerTest : public testing::Test {
storage::QuotaSettings settings;
settings.pool_size = pool_size;
settings.per_host_quota = per_host_quota;
+ settings.session_only_per_host_quota =
+ (per_host_quota > 0) ? (per_host_quota - 1) : 0;
settings.must_remain_available = must_remain_available;
settings.refresh_interval = base::TimeDelta::Max();
quota_manager_->SetQuotaSettings(settings);
@@ -2253,4 +2255,17 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) {
EXPECT_EQ(available_space() + usage(), quota());
}
+TEST_F(QuotaManagerTest, GetUsageAndQuota_SessionOnly) {
+ const GURL kEpheremalOrigin("http://ephemeral/");
+ mock_special_storage_policy()->AddSessionOnly(kEpheremalOrigin);
+
+ GetUsageAndQuotaForWebApps(kEpheremalOrigin, kTemp);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(quota_manager()->settings().session_only_per_host_quota, quota());
+
+ GetUsageAndQuotaForWebApps(kEpheremalOrigin, kPerm);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(0, quota());
+}
+
} // namespace content
« no previous file with comments | « no previous file | storage/browser/quota/quota_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698