#include "components/viz/service/display/display_scheduler.h"
#include <set>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/null_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "cc/test/scheduler_test_common.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/surfaces/surface_info.h"
#include "components/viz/service/display/display.h"
#include "components/viz/service/display/display_resource_provider_software.h"
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include "components/viz/test/begin_frame_args_test.h"
#include "components/viz/test/fake_external_begin_frame_source.h"
#include "gpu/command_buffer/service/scheduler.h"
#include "gpu/command_buffer/service/shared_image/shared_image_manager.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace viz {
namespace {
constexpr base::TimeDelta k1Usec = …;
constexpr base::TimeDelta kVSyncInterval = …;
const int kMaxPendingSwaps = …;
static constexpr FrameSinkId kArbitraryFrameSinkId(1, 1);
class TestDisplayDamageTracker : public DisplayDamageTracker { … };
class FakeDisplaySchedulerClient : public DisplaySchedulerClient { … };
class TestDisplayScheduler : public DisplayScheduler { … };
class DisplaySchedulerTest : public testing::Test { … };
void DisplaySchedulerTest::SetUp() { … }
TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilNewRootSurface) { … }
TEST_F(DisplaySchedulerTest, ResizeHasLateDeadlineUntilDamagedSurface) { … }
TEST_F(DisplaySchedulerTest, SurfaceDamaged) { … }
class DisplaySchedulerWaitForAllSurfacesTest : public DisplaySchedulerTest { … };
TEST_F(DisplaySchedulerWaitForAllSurfacesTest, WaitForAllSurfacesBeforeDraw) { … }
TEST_F(DisplaySchedulerTest, OutputSurfaceLost) { … }
TEST_F(DisplaySchedulerTest, VisibleWithoutDamageNoTicks) { … }
TEST_F(DisplaySchedulerTest, VisibleWithDamageTicks) { … }
TEST_F(DisplaySchedulerTest, Visibility) { … }
TEST_F(DisplaySchedulerTest, ResizeCausesSwap) { … }
TEST_F(DisplaySchedulerTest, RootFrameMissing) { … }
TEST_F(DisplaySchedulerTest, DidSwapBuffers) { … }
TEST_F(DisplaySchedulerTest, ScheduleBeginFrameDeadline) { … }
TEST_F(DisplaySchedulerTest, SetNeedsOneBeginFrame) { … }
TEST_F(DisplaySchedulerTest, GpuBusyNotifications) { … }
TEST_F(DisplaySchedulerTest, OnBeginFrameDeadlineNoClient) { … }
TEST_F(DisplaySchedulerTest, DefaultBeginFrameArgsDeadline) { … }
class ImmediateInteractiveDrawTest : public DisplaySchedulerTest { … };
ImmediateInteractiveDrawTest::ImmediateInteractiveDrawTest() { … }
TEST_F(ImmediateInteractiveDrawTest, DoNotWaitWhenInteracting) { … }
TEST_F(ImmediateInteractiveDrawTest, WaitWhenNotInteracting) { … }
TEST_F(ImmediateInteractiveDrawTest, ResetScrollingBitAfterDrawAndSwap) { … }
TEST_F(ImmediateInteractiveDrawTest, ResetScrollingBitOnFrameFinished) { … }
}
}