chromium/chrome/browser/policy/test/back_forward_cache_policy_browsertest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "chrome/browser/policy/policy_test_utils.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"

class Browser;

namespace policy {

enum class CacheControlNoStorePagePolicy {};
struct BackForwardCacheWithCacheControlNoStorePagePolicyTestParam {};

class BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTest
    : public PolicyTest,
      public ::testing::WithParamInterface<
          BackForwardCacheWithCacheControlNoStorePagePolicyTestParam> {};

const auto test_suite_value =;

INSTANTIATE_TEST_SUITE_P();

// Test that a page loaded with "Cache-Control:no-store" header cannot enter
// BackForwardCache if the ContentBrowserClient disables BFCache for CCNS pages.
IN_PROC_BROWSER_TEST_P(
    BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTest,
    PolicyIsFollowed) {}

// Test that the `ShouldAllowBackForwardCacheForCacheControlNoStorePage()`
// returns the correct value for different policy settings.
IN_PROC_BROWSER_TEST_P(
    BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTest,
    ShouldAllowBackForwardCacheForCacheControlNoStorePage) {}

class BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTestKioskMode
    : public BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTest {};

INSTANTIATE_TEST_SUITE_P();

// Test that a page loaded with "Cache-Control:no-store" header cannot enter
// BackForwardCache if the ContentBrowserClient disables BFCache for CCNS pages.
IN_PROC_BROWSER_TEST_P(
    BackForwardCacheWithCacheControlNoStorePagePolicyBrowserTestKioskMode,
    PolicyIsOverridenByKioskMode) {}

}  // namespace policy