 Chromium Code Reviews
 Chromium Code Reviews 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
    
  
    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| 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()); |