#include "cc/layers/layer.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "cc/animation/animation_host.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/base/math_util.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_scrollbar_layer.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/cc_test_suite.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/stub_layer_tree_host_single_thread_client.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/clip_node.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/transform_node.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/animation/keyframe/keyframed_animation_curve.h"
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/gfx/geometry/vector2d_f.h"
_;
AnyNumber;
AtLeast;
Mock;
StrictMock;
#define EXPECT_CALL_MOCK_DELEGATE(obj, call) …
#define EXPECT_SET_NEEDS_UPDATE(expect, code_to_test) …
#define EXPECT_SET_NEEDS_FULL_TREE_SYNC(expect, code_to_test) …
#define EXECUTE_AND_VERIFY_SUBTREE_CHANGED(code_to_test) …
#define EXECUTE_AND_VERIFY_SUBTREE_CHANGES_RESET(code_to_test) …
#define EXPECT_SET_NEEDS_COMMIT_WAS_CALLED(code_to_test) …
#define EXPECT_SET_NEEDS_COMMIT_WAS_NOT_CALLED(code_to_test) …
namespace cc {
namespace {
static auto kArbitrarySourceId1 = …;
static auto kArbitrarySourceId2 = …;
class MockLayerTreeHostDelegate { … };
class FakeLayerTreeHost : public LayerTreeHost { … };
bool LayerNeedsDisplay(Layer* layer) { … }
class LayerTest : public testing::Test { … };
class LayerTestWithLayerList : public LayerTest { … };
TEST_F(LayerTest, BasicCreateAndDestroy) { … }
TEST_F(LayerTest, LayerPropertyChangedForSubtree) { … }
TEST_F(LayerTest, AddAndRemoveChild) { … }
TEST_F(LayerTest, SetMaskLayer) { … }
TEST_F(LayerTest, RemoveMaskLayerFromParent) { … }
TEST_F(LayerTest, AddChildAfterSetMaskLayer) { … }
TEST_F(LayerTest, AddSameChildTwice) { … }
TEST_F(LayerTest, ReorderChildren) { … }
TEST_F(LayerTest, InsertChild) { … }
TEST_F(LayerTest, InsertChildPastEndOfList) { … }
TEST_F(LayerTest, InsertSameChildTwice) { … }
TEST_F(LayerTest, ReplaceChildWithNewChild) { … }
TEST_F(LayerTest, ReplaceChildWithNewChildThatHasOtherParent) { … }
TEST_F(LayerTest, ReplaceChildWithSameChild) { … }
TEST_F(LayerTest, RemoveAllChildren) { … }
TEST_F(LayerTest, HasAncestor) { … }
TEST_F(LayerTest, GetRootLayerAfterTreeManipulations) { … }
TEST_F(LayerTest, CheckSetNeedsDisplayCausesCorrectBehavior) { … }
TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) { … }
TEST_F(LayerTest, PushPropertiesAccumulatesUpdateRect) { … }
TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForTransform) { … }
TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForRoundCorner) { … }
TEST_F(LayerTest, PushPropertiesCausesLayerPropertyChangedForOpacity) { … }
TEST_F(LayerTest, MaskHasParent) { … }
class LayerTreeHostFactory { … };
void AssertLayerTreeHostMatchesForSubtree(Layer* layer, LayerTreeHost* host) { … }
class LayerLayerTreeHostTest : public testing::Test { … };
TEST_F(LayerLayerTreeHostTest, EnteringTree) { … }
TEST_F(LayerLayerTreeHostTest, AddingLayerSubtree) { … }
TEST_F(LayerLayerTreeHostTest, ChangeHost) { … }
TEST_F(LayerLayerTreeHostTest, ChangeHostInSubtree) { … }
TEST_F(LayerLayerTreeHostTest, ReplaceMaskLayer) { … }
TEST_F(LayerLayerTreeHostTest, DestroyHostWithNonNullRootLayer) { … }
TEST_F(LayerTest, SafeOpaqueBackgroundColor) { … }
class DrawsContentChangeLayer : public Layer { … };
TEST_F(LayerTest, DrawsContentChangedInSetLayerTreeHost) { … }
TEST_F(LayerTest, PushUpdatesShouldHitTest) { … }
void ReceiveCopyOutputResult(int* result_count,
std::unique_ptr<viz::CopyOutputResult> result) { … }
void ReceiveCopyOutputResultAtomic(
std::atomic<int>* result_count,
std::unique_ptr<viz::CopyOutputResult> result) { … }
TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) { … }
TEST_F(LayerTest, AnimationSchedulesLayerUpdate) { … }
TEST_F(LayerTest, ElementIdIsPushed) { … }
TEST_F(LayerTest, SetLayerTreeHostNotUsingLayerListsManagesElementId) { … }
TEST_F(LayerTest, PushAnimationCountsLazily) { … }
TEST_F(LayerTest, SetElementIdNotUsingLayerLists) { … }
TEST_F(LayerTest, UpdateMirrorCount) { … }
TEST_F(LayerTest, UpdatingCaptureBounds) { … }
TEST_F(LayerTest, UpdatingClipRect) { … }
TEST_F(LayerTest, UpdatingRoundedCorners) { … }
}
}