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

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

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: poolSize Created 4 years, 5 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: 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 685b2d6be93333f1a1a43396d8653d9705eb56af..2ca622f659535f423eced01df64555bbc5af0b82 100644
--- a/content/browser/quota/quota_manager_unittest.cc
+++ b/content/browser/quota/quota_manager_unittest.cc
@@ -845,19 +845,21 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Overbudget) {
SetTemporaryGlobalQuota(100);
base::RunLoop().RunUntilIdle();
+ // not sure this test is relevant anymore?
+
const int kPerHostQuota = 100 / QuotaManager::kPerHostTemporaryPortion;
GetUsageAndQuotaForWebApps(GURL("http://usage1/"), kTemp);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kQuotaStatusOk, status());
EXPECT_EQ(1, usage());
- EXPECT_EQ(1, quota()); // should be clamped to our current usage
+ EXPECT_EQ(kPerHostQuota, quota());
GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kQuotaStatusOk, status());
EXPECT_EQ(10, usage());
- EXPECT_EQ(10, quota());
+ EXPECT_EQ(kPerHostQuota, quota());
GetUsageAndQuotaForWebApps(GURL("http://usage200/"), kTemp);
base::RunLoop().RunUntilIdle();
@@ -957,7 +959,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) {
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kQuotaStatusOk, status());
EXPECT_EQ(10, usage());
- EXPECT_EQ(10, quota()); // should be clamped to our current usage
+ EXPECT_EQ(kPerHostQuotaFor100, quota());
GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp);
base::RunLoop().RunUntilIdle();
@@ -1802,16 +1804,19 @@ TEST_F(QuotaManagerTest, GetCachedOrigins) {
GetCachedOrigins(kTemp, &origins);
EXPECT_TRUE(origins.empty());
- // No matter how we make queries the quota manager tries to cache all
- // the origins at startup.
GetHostUsage("a.com", kTemp);
base::RunLoop().RunUntilIdle();
GetCachedOrigins(kTemp, &origins);
- EXPECT_EQ(3U, origins.size());
+ EXPECT_EQ(2U, origins.size());
GetHostUsage("b.com", kTemp);
base::RunLoop().RunUntilIdle();
GetCachedOrigins(kTemp, &origins);
+ EXPECT_EQ(2U, origins.size());
+
+ GetHostUsage("c.com", kTemp);
+ base::RunLoop().RunUntilIdle();
+ GetCachedOrigins(kTemp, &origins);
EXPECT_EQ(3U, origins.size());
GetCachedOrigins(kPerm, &origins);
@@ -2275,6 +2280,8 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) {
EXPECT_EQ(0, quota());
SetTemporaryGlobalQuota(100);
+ base::RunLoop().RunUntilIdle();
+
GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kQuotaStatusOk, status());

Powered by Google App Engine
This is Rietveld 408576698