Commit 1e9a49aa authored by Jarryd's avatar Jarryd Committed by Commit Bot

Quota: Enable expanded quota by default.

Bug: 897276
Change-Id: Ic79a581dde8b49c9c4194c1f24a2a0989d19bb81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1701955
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694487}
parent 98bc13f0
......@@ -8,25 +8,14 @@ namespace storage {
namespace features {
#if defined(OS_CHROMEOS)
// Chrome OS is given a larger fraction, as web content is the considered
// the primary use of the platform. Chrome OS itself maintains free space by
// starting to evict data (old profiles) when less than 1GB remains,
// stopping eviction once 2GB is free.
// Prior to M66 this was 1/3, same as other platforms.
const constexpr double kTemporaryPoolSizeRatioThirds = 2.0 / 3.0; // 66%
#else
const constexpr double kTemporaryPoolSizeRatioThirds = 1.0 / 3.0; // 33%
#endif
const base::Feature kQuotaExpandPoolSize{"QuotaExpandPoolSize",
base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_ENABLED_BY_DEFAULT};
constexpr base::FeatureParam<double> kExperimentalPoolSizeRatio{
&kQuotaExpandPoolSize, "PoolSizeRatio", kTemporaryPoolSizeRatioThirds};
&kQuotaExpandPoolSize, "PoolSizeRatio", 0.8};
constexpr base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize,
"PerHostRatio", 0.2};
"PerHostRatio", 0.75};
// StaticHostQuota enables a simpler per-host quota model, where the quota is
// only based on disk capacity (partition size). When the flag is disabled, the
......
......@@ -42,6 +42,26 @@ class QuotaSettingsTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(QuotaSettingsTest);
};
TEST_F(QuotaSettingsTest, Default) {
MockQuotaDiskInfoHelper disk_info_helper;
ON_CALL(disk_info_helper, AmountOfTotalDiskSpace(_))
.WillByDefault(::testing::Return(2000));
bool callback_executed = false;
GetNominalDynamicSettings(
profile_path(), false, &disk_info_helper,
base::BindLambdaForTesting([&](base::Optional<QuotaSettings> settings) {
callback_executed = true;
ASSERT_NE(settings, base::nullopt);
// 1600 = 2000 * default PoolSizeRatio (0.8)
EXPECT_EQ(settings->pool_size, 1600);
// 1200 = 1600 * default PerHostRatio (.75)
EXPECT_EQ(settings->per_host_quota, 1200);
}));
task_environment_.RunUntilIdle();
EXPECT_TRUE(callback_executed);
}
TEST_F(QuotaSettingsTest, ExpandedTempPool) {
MockQuotaDiskInfoHelper disk_info_helper;
ON_CALL(disk_info_helper, AmountOfTotalDiskSpace(_))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment