#include "components/viz/service/surfaces/referenced_surface_tracker.h"
#include <memory>
#include "base/containers/flat_set.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/service/surfaces/surface_reference.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
UnorderedElementsAre;
IsEmpty;
namespace viz {
namespace {
constexpr FrameSinkId kParentFrameSink(2, 1);
constexpr FrameSinkId kChildFrameSink1(65563, 1);
constexpr FrameSinkId kChildFrameSink2(65564, 1);
base::flat_set<SurfaceId> MakeReferenceSet(
std::initializer_list<SurfaceId> surface_ids) { … }
SurfaceId MakeSurfaceId(const FrameSinkId& frame_sink_id, uint32_t parent_id) { … }
}
class ReferencedSurfaceTrackerTest : public testing::Test { … };
TEST_F(ReferencedSurfaceTrackerTest, AddSurfaceReference) { … }
TEST_F(ReferencedSurfaceTrackerTest, NoChangeToReferences) { … }
TEST_F(ReferencedSurfaceTrackerTest, RemoveSurfaceReference) { … }
TEST_F(ReferencedSurfaceTrackerTest, RemoveOneOfTwoSurfaceReferences) { … }
TEST_F(ReferencedSurfaceTrackerTest, AddTwoThenRemoveOneSurfaceReferences) { … }
}