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

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: Created 4 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.h » ('j') | storage/browser/quota/quota_manager.cc » ('J')
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 665acd953b7259aa944f86de995fc14844d4bde9..928b4199e9ed9373720b7315ea7c61b79fb42c28 100644
--- a/content/browser/quota/quota_manager_unittest.cc
+++ b/content/browser/quota/quota_manager_unittest.cc
@@ -844,19 +844,21 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Overbudget) {
SetTemporaryGlobalQuota(100);
base::RunLoop().RunUntilIdle();
+ // not sure this test is relevant anymore?
michaeln 2016/04/07 20:54:47 tests aren't ready yet, all i've done thusfar is m
+
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();
@@ -956,7 +958,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();
@@ -1801,16 +1803,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);
@@ -2274,6 +2279,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());
« no previous file with comments | « no previous file | storage/browser/quota/quota_manager.h » ('j') | storage/browser/quota/quota_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698