#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/viz/service/display/frame_rate_decider.h"
#include <memory>
#include <string_view>
#include "base/functional/callback_helpers.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h"
#include "components/viz/common/surfaces/surface_info.h"
#include "components/viz/service/surfaces/surface.h"
#include "components/viz/service/surfaces/surface_manager.h"
#include "components/viz/service/surfaces/surface_manager_delegate.h"
#include "components/viz/test/compositor_frame_helpers.h"
#include "components/viz/test/stub_surface_client.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
namespace viz {
namespace {
class FrameRateDeciderTest : public testing::Test,
public FrameRateDecider::Client,
public SurfaceManagerDelegate { … };
TEST_F(FrameRateDeciderTest, ActiveSurfaceTrackingFrameIndexChange) { … }
TEST_F(FrameRateDeciderTest, ActiveSurfaceTrackingSurfaceIdChange) { … }
TEST_F(FrameRateDeciderTest,
SurfaceWithMinIntervalPicksLowestSupportedInterval) { … }
TEST_F(FrameRateDeciderTest, OptimalFrameSinkIntervalIsPicked) { … }
#if BUILDFLAG(IS_APPLE)
#define MAYBE_MinFrameSinkIntervalIsPicked …
#else
#define MAYBE_MinFrameSinkIntervalIsPicked …
#endif
TEST_F(FrameRateDeciderTest, MAYBE_MinFrameSinkIntervalIsPicked) { … }
TEST_F(FrameRateDeciderTest, TogglesAfterMinNumOfFrames) { … }
TEST_F(FrameRateDeciderTest, TogglesWithSyntheticBFS) { … }
TEST_F(FrameRateDeciderTest, ManySinksWithMinInterval) { … }
TEST_F(FrameRateDeciderTest, NoFixedIntervalSurfaces) { … }
TEST_F(FrameRateDeciderTest, NoHwSupportForMultiRefreshRates) { … }
}
}