Commit 11c41a6a authored by Arthur Hemery's avatar Arthur Hemery Committed by Commit Bot

[bfcache] Add a content feature to disable time eviction.

Default period content can be cached is 15 seconds with the BackForwardCache
enabled. Long tests with timeouts of more than 15 seconds can technically pass
tests by waiting for 15 seconds and getting the usual notifications from the
RenderFrameHost being destroyed.

We want to identify these tests, so we add a content feature that removes all
time limit to how long we can keep something in the cache.

Change-Id: Ib0736c9ba6f0718fbc9ba729a1e3742d61721a65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852448Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705104}
parent 6628ce1b
......@@ -26,6 +26,11 @@ namespace {
using blink::scheduler::WebSchedulerTrackedFeature;
// Removes the time limit for cached content. This is used on bots to identify
// accidentally passing tests.
const base::Feature kBackForwardCacheNoTimeEviction{
"BackForwardCacheNoTimeEviction", base::FEATURE_DISABLED_BY_DEFAULT};
// The number of entries the BackForwardCache can hold per tab.
static constexpr size_t kBackForwardCacheLimit = 1;
......@@ -236,6 +241,9 @@ BackForwardCacheImpl::BackForwardCacheImpl()
BackForwardCacheImpl::~BackForwardCacheImpl() = default;
base::TimeDelta BackForwardCacheImpl::GetTimeToLiveInBackForwardCache() {
if (base::FeatureList::IsEnabled(kBackForwardCacheNoTimeEviction))
return base::TimeDelta::Max();
return base::TimeDelta::FromSeconds(base::GetFieldTrialParamByFeatureAsInt(
features::kBackForwardCache, "TimeToLiveInBackForwardCacheInSeconds",
kDefaultTimeToLiveInBackForwardCacheInSeconds));
......
......@@ -104,7 +104,7 @@
"gtest_tests": [
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.android_browsertests.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......@@ -151,7 +151,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.chrome_public_test_apk.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......@@ -199,7 +199,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_browsertests.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......@@ -247,7 +247,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_shell_test_apk.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......@@ -295,7 +295,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_unittests.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......@@ -343,7 +343,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.unit_tests.filter",
"--gs-results-bucket=chromium-result-details",
"--recover-devices"
......
......@@ -10634,7 +10634,7 @@
"gtest_tests": [
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.browser_tests.filter"
],
"merge": {
......@@ -10655,7 +10655,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_browsertests.filter"
],
"merge": {
......@@ -10676,7 +10676,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_unittests.filter"
],
"merge": {
......@@ -10697,7 +10697,7 @@
},
{
"args": [
"--enable-features=BackForwardCache",
"--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction",
"--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.unit_tests.filter"
],
"merge": {
......
......@@ -235,14 +235,14 @@
'bfcache_android_specific_gtests': {
'bf_cache_android_browsertests': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.android_browsertests.filter'
],
'test': 'android_browsertests',
},
'bf_cache_content_shell_test_apk': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_shell_test_apk.filter'
],
'swarming': {
......@@ -252,7 +252,7 @@
},
'bf_cache_chrome_public_test_apk': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.chrome_public_test_apk.filter'
],
'swarming': {
......@@ -265,7 +265,7 @@
'bfcache_generic_gtests': {
'bf_cache_content_unittests': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_unittests.filter'
],
'swarming': {
......@@ -275,7 +275,7 @@
},
'bf_cache_unit_tests': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.unit_tests.filter'
],
'swarming': {
......@@ -285,7 +285,7 @@
},
'bf_cache_content_browsertests': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.content_browsertests.filter'
],
'swarming': {
......@@ -298,7 +298,7 @@
'bfcache_linux_specific_gtests': {
'bf_cache_browser_tests': {
'args': [
'--enable-features=BackForwardCache',
'--enable-features=BackForwardCache,BackForwardCacheNoTimeEviction',
'--test-launcher-filter-file=../../testing/buildbot/filters/bfcache.browser_tests.filter'
],
'swarming': {
......
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