chromium/components/viz/service/frame_sinks/surface_references_unittest.cc

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

#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);

}  // namespace

// Tests for reference tracking in CompositorFrameSinkSupport and
// SurfaceManager.
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) {}

// Verify that surfaces marked as live are not garbage collected and any
// dependencies are also not garbage collected.
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) {}

// Checks that adding a surface reference clears the temporary reference.
TEST_F(SurfaceReferencesTest, InvalidateHasNoEffectOnSurfaceReferences) {}

// Check that old temporary references are deleted, but only for surfaces marked
// as destroyed.
TEST_F(SurfaceReferencesTest, MarkOldTemporaryReferences) {}

}  // namespace viz