#include <stddef.h>
#include <unordered_map>
#include <vector>
#include "base/containers/flat_set.h"
#include "base/test/test_mock_time_task_runner.h"
#include "components/viz/common/surfaces/surface_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/surface.h"
#include "components/viz/service/surfaces/surface_manager.h"
#include "components/viz/test/compositor_frame_helpers.h"
#include "components/viz/test/surface_id_allocator_set.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
ElementsAre;
IsEmpty;
SizeIs;
UnorderedElementsAre;
namespace viz {
namespace {
constexpr FrameSinkId kFrameSink1(1, 0);
constexpr FrameSinkId kFrameSink2(2, 0);
constexpr FrameSinkId kFrameSink3(3, 0);
}
class SurfaceReferencesTest : public testing::Test { … };
TEST_F(SurfaceReferencesTest, AddReference) { … }
TEST_F(SurfaceReferencesTest, AddRemoveReference) { … }
TEST_F(SurfaceReferencesTest, NewSurfaceFromFrameSink) { … }
TEST_F(SurfaceReferencesTest, ReferenceCycleGetsDeleted) { … }
TEST_F(SurfaceReferencesTest, SurfacesAreDeletedDuringGarbageCollection) { … }
TEST_F(SurfaceReferencesTest, GarbageCollectionWorksRecursively) { … }
TEST_F(SurfaceReferencesTest, LiveSurfaceStillReachable) { … }
TEST_F(SurfaceReferencesTest, TryAddReferenceSameReferenceTwice) { … }
TEST_F(SurfaceReferencesTest, AddingSelfReferenceFails) { … }
TEST_F(SurfaceReferencesTest, RemovingNonexistantReferenceFails) { … }
TEST_F(SurfaceReferencesTest, AddSurfaceThenReference) { … }
TEST_F(SurfaceReferencesTest, AddSurfaceThenRootReference) { … }
TEST_F(SurfaceReferencesTest, AddTwoSurfacesThenOneReference) { … }
TEST_F(SurfaceReferencesTest, AddSurfacesSkipReference) { … }
TEST_F(SurfaceReferencesTest, RemoveFirstTempReferenceOnly) { … }
TEST_F(SurfaceReferencesTest, SurfaceWithTemporaryReferenceIsDeleted) { … }
TEST_F(SurfaceReferencesTest, InvalidateHasNoEffectOnSurfaceReferences) { … }
TEST_F(SurfaceReferencesTest, MarkOldTemporaryReferences) { … }
}