Commit 23f689d2 authored by Arthur Hemery's avatar Arthur Hemery Committed by Commit Bot

[bfcache] Disable infinite timeout for bfcache test suite.

Currently kBackForwardCacheNoTimeEviction overrides specific setup in
the BackForwardCacheTest suite, where we want to preserve the previous
behavior. Explicitly override it at construction time.

Change-Id: I39cc378f2cc03bd798ef4306db6eeecfd8abc72b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859790Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705996}
parent f8a2d674
......@@ -241,8 +241,16 @@ BackForwardCacheImpl::BackForwardCacheImpl()
BackForwardCacheImpl::~BackForwardCacheImpl() = default;
base::TimeDelta BackForwardCacheImpl::GetTimeToLiveInBackForwardCache() {
if (base::FeatureList::IsEnabled(kBackForwardCacheNoTimeEviction))
// We use the following order of priority if multiple values exist:
// - The programmatical value set in params. Used in specific tests.
// - Infinite if kBackForwardCacheNoTimeEviction is enabled.
// - Default value otherwise, kDefaultTimeToLiveInBackForwardCacheInSeconds.
if (base::FeatureList::IsEnabled(kBackForwardCacheNoTimeEviction) &&
GetFieldTrialParamValueByFeature(features::kBackForwardCache,
"TimeToLiveInBackForwardCacheInSeconds")
.empty()) {
return base::TimeDelta::Max();
}
return base::TimeDelta::FromSeconds(base::GetFieldTrialParamByFeatureAsInt(
features::kBackForwardCache, "TimeToLiveInBackForwardCacheInSeconds",
......
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