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 6a7d1d9be47233e0d003b3de32aa77d5fac5385b..bf61ff3d22c81155a83dd5ebd8a05aa465ac5190 100644 |
| --- a/content/browser/quota/quota_manager_unittest.cc |
| +++ b/content/browser/quota/quota_manager_unittest.cc |
| @@ -1377,19 +1377,40 @@ TEST_F(QuotaManagerTest, EvictOriginDataHistogram) { |
| EvictOriginData(GURL("http://foo.com/"), kTemp); |
| base::RunLoop().RunUntilIdle(); |
| + // Ensure used count and time since access are recorded. |
| + histograms.ExpectTotalCount( |
| + QuotaManager::kEvictedOriginAccessedCountHistogram, 1); |
| + histograms.ExpectBucketCount( |
| + QuotaManager::kEvictedOriginAccessedCountHistogram, 0, 1); |
| + histograms.ExpectTotalCount( |
| + QuotaManager::kEvictedOriginTimeSinceAccessHistogram, 1); |
|
michaeln
2015/11/05 00:01:23
ooops, wait... this test is red?
calamity
2015/11/05 07:10:47
Only ran quota database tests locally after the ch
|
| + |
| // First eviction has no 'last' time to compare to. |
| histograms.ExpectTotalCount( |
| QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram, 0); |
| client->AddOriginAndNotify(GURL("http://foo.com"), kTemp, 100); |
| + // Change the used count of the origin. |
| + quota_manager()->NotifyStorageAccessed(QuotaClient::kUnknown, GURL(kOrigin), |
| + kTemp); |
| + base::RunLoop().RunUntilIdle(); |
| + |
| GetGlobalUsage(kTemp); |
| base::RunLoop().RunUntilIdle(); |
| EvictOriginData(GURL("http://foo.com/"), kTemp); |
| base::RunLoop().RunUntilIdle(); |
| - // Second eviction should log a histogram sample. |
| + // The new used count should be logged. |
| + histograms.ExpectTotalCount( |
| + QuotaManager::kEvictedOriginAccessedCountHistogram, 2); |
| + histograms.ExpectBucketCount( |
| + QuotaManager::kEvictedOriginAccessedCountHistogram, 1, 1); |
| + histograms.ExpectTotalCount( |
| + QuotaManager::kEvictedOriginTimeSinceAccessHistogram, 2); |
| + |
| + // Second eviction should log a 'time between repeated eviction' sample. |
| histograms.ExpectTotalCount( |
| QuotaManager::kTimeBetweenRepeatedOriginEvictionsHistogram, 1); |