chromium/chrome/browser/performance_manager/policies/bfcache_policy_browsertest.cc

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

#include <memory>
#include <string>

#include "base/functional/callback_forward.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "chrome/browser/performance_manager/mechanisms/page_discarder.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/memory_pressure/fake_memory_pressure_monitor.h"
#include "components/performance_manager/public/features.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/visibility.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_features.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gmock/include/gmock/gmock.h"

#if BUILDFLAG(IS_WIN)
#include "ui/base/ui_base_features.h"
#endif

namespace performance_manager::policies {

namespace {

MemoryPressureLevel;

struct PolicyTestParam {};

const PolicyTestParam kPolicyTestParams[] =;

class BFCachePolicyBrowserTest
    : public InProcessBrowserTest,
      public ::testing::WithParamInterface<PolicyTestParam> {};

}  // namespace

// TODO(https://crbug.com/1335514, https://crbug.com/1494579): Flaky.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#define MAYBE_CacheFlushed
#else
#define MAYBE_CacheFlushed
#endif
IN_PROC_BROWSER_TEST_P(BFCachePolicyBrowserTest, MAYBE_CacheFlushed) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace performance_manager::policies