Chromium Code Reviews| 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 9c1d7aa6ae37b75e2e8bdefb42c6735426c2477e..90c06e725728018c9dc14c8452ec3e5293f869b0 100644 |
| --- a/content/browser/quota/quota_manager_unittest.cc |
| +++ b/content/browser/quota/quota_manager_unittest.cc |
| @@ -167,6 +167,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) : INT64_C(0); |
|
Thiemo Nagel
2017/04/10 09:41:37
Nit: What's the purpose of INT64_C() here?
michaeln
2017/04/10 23:15:35
I'll remove it if its not needed to compile withou
|
| settings.must_remain_available = must_remain_available; |
| settings.refresh_interval = base::TimeDelta::Max(); |
| quota_manager_->SetQuotaSettings(settings); |
| @@ -2252,4 +2254,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 |