#include <utility>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "cc/test/scheduler_test_common.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "components/viz/common/surfaces/subtree_capture_id.h"
#include "components/viz/service/display_embedder/server_shared_bitmap_manager.h"
#include "components/viz/service/frame_sinks/compositor_frame_sink_support.h"
#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
#include "components/viz/service/surfaces/pending_copy_output_request.h"
#include "components/viz/service/surfaces/surface.h"
#include "components/viz/test/begin_frame_args_test.h"
#include "components/viz/test/compositor_frame_helpers.h"
#include "components/viz/test/fake_external_begin_frame_source.h"
#include "components/viz/test/mock_compositor_frame_sink_client.h"
#include "components/viz/test/test_surface_id_allocator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
namespace viz {
namespace {
constexpr FrameSinkId kArbitraryFrameSinkId(1, 1);
constexpr bool kIsRoot = …;
const uint64_t kBeginFrameSourceId = …;
class SurfaceTest : public testing::Test { … };
class OnBeginFrameAcksSurfaceTest : public SurfaceTest,
public testing::WithParamInterface<bool> { … };
OnBeginFrameAcksSurfaceTest::OnBeginFrameAcksSurfaceTest() { … }
TEST_P(OnBeginFrameAcksSurfaceTest, PresentationCallback) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(SurfaceTest, SurfaceIds) { … }
void TestCopyResultCallback(bool* called,
base::OnceClosure finished,
std::unique_ptr<CopyOutputResult> result) { … }
TEST_F(SurfaceTest, CopyRequestLifetime) { … }
TEST_F(SurfaceTest, ActiveSurfaceReferencesWithOverlappingReferences) { … }
TEST_F(SurfaceTest, PendingCopySurfaceIncludedInActiveReferencedSurfaces) { … }
class ImmediateActivationSurfaceTest
: public SurfaceTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ImmediateActivationSurfaceTest, WithNoInteraction) { … }
TEST_P(ImmediateActivationSurfaceTest, WithInteraction) { … }
}
}