chromium/components/viz/service/display/frame_rate_decider_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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)
// TODO(crbug.com/40255724): currently failing on iOS.
#define MAYBE_MinFrameSinkIntervalIsPicked
#else
#define MAYBE_MinFrameSinkIntervalIsPicked
#endif  // BUILDFLAG(IS_APPLE)
TEST_F(FrameRateDeciderTest, MAYBE_MinFrameSinkIntervalIsPicked) {}

TEST_F(FrameRateDeciderTest, TogglesAfterMinNumOfFrames) {}

TEST_F(FrameRateDeciderTest, TogglesWithSyntheticBFS) {}

TEST_F(FrameRateDeciderTest, ManySinksWithMinInterval) {}

// If there are no fixed frame sources, we should not lower the frame interval.
TEST_F(FrameRateDeciderTest, NoFixedIntervalSurfaces) {}

TEST_F(FrameRateDeciderTest, NoHwSupportForMultiRefreshRates) {}

}  // namespace
}  // namespace viz