#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/trees/layer_tree_host.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <memory>
#include "base/auto_reset.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/lock.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "cc/animation/animation_host.h"
#include "cc/base/features.h"
#include "cc/input/scroll_elasticity_helper.h"
#include "cc/layers/content_layer_client.h"
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/video_layer.h"
#include "cc/layers/view_transition_content_layer.h"
#include "cc/metrics/begin_main_frame_metrics.h"
#include "cc/metrics/events_metrics_manager.h"
#include "cc/metrics/ukm_smoothness_data.h"
#include "cc/paint/image_animation_count.h"
#include "cc/resources/ui_resource_manager.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_frame_info.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_paint_image_generator.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/fake_recording_source.h"
#include "cc/test/fake_scoped_ui_resource.h"
#include "cc/test/fake_scrollbar_layer.h"
#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/mock_latency_info_swap_promise_monitor.h"
#include "cc/test/push_properties_counting_layer.h"
#include "cc/test/push_properties_counting_layer_impl.h"
#include "cc/test/render_pass_test_utils.h"
#include "cc/test/skia_common.h"
#include "cc/test/stub_input_handler_client.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "cc/trees/clip_node.h"
#include "cc/trees/compositor_commit_data.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/paint_holding_reason.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/swap_promise.h"
#include "cc/trees/swap_promise_manager.h"
#include "cc/trees/transform_node.h"
#include "cc/view_transition/view_transition_request.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/common/quads/compositor_frame_transition_directive.h"
#include "components/viz/common/quads/compositor_render_pass_draw_quad.h"
#include "components/viz/common/quads/draw_quad.h"
#include "components/viz/common/quads/tile_draw_quad.h"
#include "components/viz/service/display/output_surface.h"
#include "components/viz/service/display/skia_output_surface.h"
#include "components/viz/test/begin_frame_args_test.h"
#include "components/viz/test/fake_output_surface.h"
#include "components/viz/test/test_raster_interface.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "ui/gfx/animation/keyframe/timing_function.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/test/geometry_util.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
#define EXPECT_SCOPED(statements) …
_;
AnyNumber;
AtLeast;
Mock;
StrictMock;
namespace cc {
namespace {
bool LayerSubtreeHasCopyRequest(Layer* layer) { … }
FrameInfo CreateFakeImplDroppedFrameInfo() { … }
LayerTreeHostTest;
class LayerTreeHostTestHasImplThreadTest : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHasImplThreadTest);
class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommitInsideLayout);
class LayerTreeHostTestFrameOrdering : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestFrameOrdering);
class LayerTreeHostTestUpdateLayersFrameOrdering
: public LayerTreeHostTestFrameOrdering { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayersFrameOrdering);
class LayerTreeHostTestRequestedMainFrame : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestRequestedMainFrame);
class LayerTreeHostTestSchedulingClient : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSchedulingClient);
class LayerTreeHostTestSetNeedsUpdateInsideLayout : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsUpdateInsideLayout);
class LayerTreeHostTestReadyToActivateEmpty : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateEmpty);
class LayerTreeHostTestReadyToActivateNonEmpty
: public LayerTreeHostTestReadyToActivateEmpty { … };
class LayerTreeHostTestReadyToDrawEmpty : public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawEmpty);
class LayerTreeHostTestReadyToDrawNonEmpty
: public LayerTreeHostTestReadyToDrawEmpty { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty);
class LayerTreeHostTestReadyToDrawVisibility : public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawVisibility);
class LayerTreeHostContextCacheTest : public LayerTreeHostTest { … };
class LayerTreeHostFreesContextResourcesOnInvisible
: public LayerTreeHostContextCacheTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostFreesContextResourcesOnInvisible);
class LayerTreeHostFreesWorkerContextResourcesOnZeroMemoryLimit
: public LayerTreeHostContextCacheTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostFreesWorkerContextResourcesOnZeroMemoryLimit);
class LayerTreeHostFreesWorkerContextResourcesOnZeroMemoryLimitSynchronous
: public LayerTreeHostFreesWorkerContextResourcesOnZeroMemoryLimit { … };
MULTI_THREAD_TEST_F(
LayerTreeHostFreesWorkerContextResourcesOnZeroMemoryLimitSynchronous);
class LayerTreeHostFreeContextResourcesOnDestroy
: public LayerTreeHostContextCacheTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostFreeContextResourcesOnDestroy);
class LayerTreeHostCacheBehaviorOnLayerTreeFrameSinkRecreated
: public LayerTreeHostContextCacheTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostCacheBehaviorOnLayerTreeFrameSinkRecreated);
class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit1);
class LayerTreeHostTestSetNeedsCommit2 : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit2);
class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesTo);
class LayerTreeHostTestInvisibleLayersSkipRenderPass
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestInvisibleLayersSkipRenderPass);
class LayerTreeHostTestPushNodeOwnerToNodeIdMap : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushNodeOwnerToNodeIdMap);
class LayerTreeHostTestPushElementIdToNodeIdMap : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushElementIdToNodeIdMap);
class LayerTreeHostTestSurfaceDamage : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSurfaceDamage);
class LayerTreeHostTestLayerListSurfaceDamage : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLayerListSurfaceDamage);
class LayerTreeHostTestNoDamageCausesNoInvalidate : public LayerTreeHostTest { … };
class LayerTreeHostTestEarlyDamageCheckStops : public LayerTreeHostTest { … };
class LayerTreeHostTestPrepareTilesWithoutDraw : public LayerTreeHostTest { … };
class LayerTreeHostTestCantDrawBeforeCommit : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestCantDrawBeforeCommit);
class LayerTreeHostTestCantDrawBeforeCommitActivate : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestCantDrawBeforeCommitActivate);
class LayerTreeHostTestPropertyTreesChangedSync : public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestPropertyTreesChangedSync);
class LayerTreeHostTestAnimationOpacityMutatedNotUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(
LayerTreeHostTestAnimationOpacityMutatedNotUsingLayerLists);
class LayerTreeHostTestAnimationOpacityMutatedUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestAnimationOpacityMutatedUsingLayerLists);
class LayerTreeHostTestAnimationTransformMutatedNotUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(
LayerTreeHostTestAnimationTransformMutatedNotUsingLayerLists);
class LayerTreeHostTestAnimationTransformMutatedUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestAnimationTransformMutatedUsingLayerLists);
class LayerTreeHostTestAnimationFilterMutatedNotUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestAnimationFilterMutatedNotUsingLayerLists);
class LayerTreeHostTestAnimationFilterMutatedUsingLayerLists
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestAnimationFilterMutatedUsingLayerLists);
class LayerTreeHostTestEffectTreeSync : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestEffectTreeSync);
class LayerTreeHostTestTransformTreeSync : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTransformTreeSync);
class LayerTreeHostTestTransformTreeDamageIsUpdated : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTransformTreeDamageIsUpdated);
class UpdateCountingLayer : public PictureLayer { … };
class LayerTreeHostTestSwitchMaskLayer : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSwitchMaskLayer);
class LayerTreeHostTestSetNeedsRedraw : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsRedraw);
class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsRedrawRect);
class LayerTreeHostTestGpuRasterDeviceSizeChanged : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged);
class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate);
class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
: public LayerTreeHostTest { … };
class LayerTreeHostTestDeviceScaleFactorChange : public LayerTreeHostTest { … };
class LayerTreeHostTestRasterColorSpaceChange : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestRasterColorSpaceChange);
class LayerTreeHostTestSetNeedsCommitWithForcedRedraw
: public LayerTreeHostTest { … };
MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostTestSetNeedsCommitWithForcedRedraw);
class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUndrawnLayersDamageLater);
class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithScale);
class LayerTreeHostTestCommit : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
: public LayerTreeHostTest { … };
MULTI_THREAD_BLOCKNOTIFY_TEST_F(
LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterDraw);
class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation);
class ViewportDeltasAppliedDuringPinch : public LayerTreeHostTest,
public ScrollCallbacks { … };
MULTI_THREAD_TEST_F(ViewportDeltasAppliedDuringPinch);
class LayerTreeHostTestSetVisible : public LayerTreeHostTest { … };
class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousInvalidate);
class LayerTreeHostTestDeferMainFrameUpdate : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferMainFrameUpdate);
class LayerTreeHostInvalidLocalSurfaceIdDefersCommit
: public LayerTreeHostTestDeferMainFrameUpdate { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostInvalidLocalSurfaceIdDefersCommit);
class LayerTreeHostTestDeferMainFrameUpdateInsideBeginMainFrame
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestDeferMainFrameUpdateInsideBeginMainFrame);
class LayerTreeHostTestDeferInsideBeginMainFrameWithCommitAfter
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestDeferInsideBeginMainFrameWithCommitAfter);
class LayerTreeHostTestAnimateOnlyBeginFrames
: public LayerTreeHostTest,
public viz::ExternalBeginFrameSourceClient { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestAnimateOnlyBeginFrames);
class LayerTreeHostTestCompositeImmediatelyStateTransitions
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestCompositeImmediatelyStateTransitions);
class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(
LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { … };
class OnDrawLayerTreeFrameSink : public TestLayerTreeFrameSink { … };
class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor
: public LayerTreeHostTestAbortedCommitDoesntStall { … };
class LayerTreeHostTestSynchronousCompositorActivateWithoutDraw
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSynchronousCompositorActivateWithoutDraw);
class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation);
class LayerTreeHostTestUIResource : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestUIResource);
class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties);
class LayerTreeHostTestImplLayersPushProperties
: public LayerTreeHostTestLayersPushProperties { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImplLayersPushProperties);
class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed);
class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit);
class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
: public LayerTreeHostTest { … };
class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush);
class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion);
class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(
LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence);
class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(
LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree);
class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(
LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild);
class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { … };
MULTI_THREAD_TEST_F(
LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent);
class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTreeActivationCallback);
class LayerInvalidateCausesDraw : public LayerTreeHostTest { … };
class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushHiddenLayer);
class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport);
class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll);
struct TestSwapPromiseResult { … };
class TestSwapPromise : public SwapPromise { … };
class PinnedLayerTreeSwapPromise : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(PinnedLayerTreeSwapPromise);
class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromise);
class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromiseMFBA);
class LayerTreeHostTestDeferSwapPromiseForVisibility
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferSwapPromiseForVisibility);
class LayerTreeHostTestSwapPromiseDuringCommit : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestSwapPromiseDuringCommit);
class LayerTreeHostTestLatencyInfoSwapPromiseMonitor
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLatencyInfoSwapPromiseMonitor);
class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestHighResRequiredAfterEvictingUIResources);
class LayerTreeHostTestGpuRasterizationDisabled : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationDisabled);
class LayerTreeHostTestGpuRasterizationSupportedButDisabled
: public LayerTreeTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationSupportedButDisabled);
class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled);
class LayerTreeHostTestGpuRasterizationEnabledWithMSAA : public LayerTreeTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabledWithMSAA);
class LayerTreeHostTestWillBeginImplFrameHasDidFinishImplFrame
: public LayerTreeHostTest { … };
::testing::AssertionResult AssertFrameTimeContained(
const char* haystack_expr,
const char* needle_expr,
const std::vector<viz::BeginFrameArgs> haystack,
const viz::BeginFrameArgs needle) { … }
class LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestBeginMainFrameTimeIsAlsoImplTime);
class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest { … };
MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestActivateOnInvisible);
class LayerTreeHostTestRenderSurfaceEffectTreeIndex : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestRenderSurfaceEffectTreeIndex);
class LayerTreeHostTestSynchronousCompositeSwapPromise
: public LayerTreeHostTest { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise);
class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer);
class NoOpApplyCompositorChangesDoesNotBlock : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(NoOpApplyCompositorChangesDoesNotBlock);
class LayerTreeHostTestCrispUpAfterPinchEnds : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestCrispUpAfterPinchEnds);
class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(RasterizeWithGpuRasterizationCreatesResources);
class GpuRasterizationRasterizesBorderTiles : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationRasterizesBorderTiles);
class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles);
class LayerTreeHostTestOneActivatePerPrepareTiles : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestOneActivatePerPrepareTiles);
class LayerTreeHostTestActivationCausesPrepareTiles : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestActivationCausesPrepareTiles);
class LayerTreeHostTestNoTasksBetweenWillAndDidCommit
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoTasksBetweenWillAndDidCommit);
class LayerTreeHostTestUpdateCopyRequests : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateCopyRequests);
class LayerTreeTestPageScaleFlags : public LayerTreeTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeTestPageScaleFlags);
class LayerTreeHostTestDestroyWhileInitializingOutputSurface
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
class LayerTreeHostTestPresentationTime : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPresentationTime);
class LayerTreeHostTestLocalSurfaceId : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLocalSurfaceId);
class LayerTreeHostTestLocalSurfaceIdSkipChildNum : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLocalSurfaceIdSkipChildNum);
class LayerTreeHostTestRequestNewLocalSurfaceId : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestRequestNewLocalSurfaceId);
class GpuRasterizationSucceedsWithLargeImage : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(GpuRasterizationSucceedsWithLargeImage);
class LayerTreeHostTestSubmitFrameMetadata : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameMetadata);
class LayerTreeHostTestSubmitFrameResources : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
class LayerTreeHostTestBeginFrameAcks : public LayerTreeHostTest { … };
MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestBeginFrameAcks);
class LayerTreeHostTestQueueImageDecode : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestQueueImageDecode);
class LayerTreeHostTestQueueImageDecodeNonLazy : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestQueueImageDecodeNonLazy);
class LayerTreeHostTestHudLayerWithLayerLists : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHudLayerWithLayerLists);
class LayerTreeHostTestImageAnimation : public LayerTreeHostTest { … };
class LayerTreeHostTestImageAnimationDrawImage
: public LayerTreeHostTestImageAnimation { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageAnimationDrawImage);
class LayerTreeHostTestImageAnimationDrawImageShader
: public LayerTreeHostTestImageAnimation { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageAnimationDrawImageShader);
class LayerTreeHostTestImageAnimationDrawRecordShader
: public LayerTreeHostTestImageAnimation { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageAnimationDrawRecordShader);
class LayerTreeHostTestImageAnimationPaintFilter
: public LayerTreeHostTestImageAnimation { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageAnimationPaintFilter);
class LayerTreeHostTestImageAnimationSynchronousScheduling
: public LayerTreeHostTestImageAnimationDrawImage { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageAnimationSynchronousScheduling);
class LayerTreeHostTestImageAnimationSynchronousSchedulingSoftwareDraw
: public LayerTreeHostTestImageAnimationSynchronousScheduling { … };
class LayerTreeHostTestImageDecodingHints : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestImageDecodingHints);
class DontUpdateLayersWithEmptyBounds : public LayerTreeTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(DontUpdateLayersWithEmptyBounds);
class LayerTreeHostTestNewLocalSurfaceIdForcesDraw : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNewLocalSurfaceIdForcesDraw);
class LayerTreeHostTestRequestForceSendMetadata
: public LayerTreeHostTest,
public RenderFrameMetadataObserver { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestRequestForceSendMetadata);
class LayerTreeHostTestPartialTileDamage : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestPartialTileDamage);
class LayerTreeHostTopControlsDeltaTriggersViewportUpdate
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTopControlsDeltaTriggersViewportUpdate);
#if BUILDFLAG(IS_CHROMEOS)
constexpr MutatorHost::TrackedAnimationSequenceId kSequenceId = 1u;
class LayerTreeHostCustomThroughputTrackerTest : public LayerTreeHostTest {
public:
void InitializeSettings(LayerTreeSettings* settings) override {
settings->is_layer_tree_for_ui = true;
}
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void DidCommit() override {
switch (layer_tree_host()->SourceFrameNumber()) {
case 1:
animation_host()->StartThroughputTracking(kSequenceId);
break;
case 3:
animation_host()->StopThroughputTracking(kSequenceId);
break;
default:
break;
}
if (!TestEnded())
PostSetNeedsCommitWithForcedRedrawToMainThread();
}
void NotifyThroughputTrackerResults(CustomTrackerResults results) override {
ASSERT_TRUE(base::Contains(results, kSequenceId));
EndTest();
}
std::unique_ptr<BeginMainFrameMetrics> GetBeginMainFrameMetrics() override {
std::unique_ptr<BeginMainFrameMetrics> metrics =
std::make_unique<BeginMainFrameMetrics>();
metrics->should_measure_smoothness = true;
return metrics;
}
};
SINGLE_THREAD_TEST_F(LayerTreeHostCustomThroughputTrackerTest);
#endif
class LayerTreeHostTestDelegatedInkMetadataBase
: public LayerTreeHostTest,
public RenderFrameMetadataObserver { … };
class LayerTreeHostTestDelegatedInkMetadataOnAndOff
: public LayerTreeHostTestDelegatedInkMetadataBase { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDelegatedInkMetadataOnAndOff);
class LayerTreeHostTestDelegatedInkMetadataCompositorOnlyFrame
: public viz::ExternalBeginFrameSourceClient,
public LayerTreeHostTestDelegatedInkMetadataBase { … };
#if !(BUILDFLAG(IS_WIN) && defined(ADDRESS_SANITIZER))
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestDelegatedInkMetadataCompositorOnlyFrame);
#endif
class LayerTreeHostTestEventsMetrics : public LayerTreeHostTest { … };
class LayerTreeHostTestKeepEventsMetricsForVisibility
: public LayerTreeHostTestEventsMetrics { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestKeepEventsMetricsForVisibility);
class LayerTreeHostTestKeepEventsMetricsForDeferredMainFrameUpdate
: public LayerTreeHostTestEventsMetrics { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestKeepEventsMetricsForDeferredMainFrameUpdate);
class LayerTreeHostTestKeepEventsMetricsForDeferredCommit
: public LayerTreeHostTestEventsMetrics { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestKeepEventsMetricsForDeferredCommit);
class LayerTreeHostTestIgnoreEventsMetricsForNoUpdate
: public LayerTreeHostTestEventsMetrics { … };
class LayerTreeHostUkmSmoothnessMetric : public LayerTreeTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostUkmSmoothnessMetric);
class LayerTreeHostUkmSmoothnessMemoryOwnership : public LayerTreeTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostUkmSmoothnessMemoryOwnership);
class LayerTreeHostTestViewTransitionsPropagatedToMetadata
: public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(
LayerTreeHostTestViewTransitionsPropagatedToMetadata);
class LayerTreeHostTestDebugStateDowngrade : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDebugStateDowngrade);
class LayerTreeHostTestClearCaches : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestClearCaches);
class LayerTreeHostTestWithHelper : public LayerTreeHostTest { … };
class LayerTreeHostTestHideLayerAndSubtree
: public LayerTreeHostTestWithHelper { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestHideLayerAndSubtree);
class LayerTreeHostTestHideLayerAndSubtreeOnParent
: public LayerTreeHostTestWithHelper { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestHideLayerAndSubtreeOnParent);
class LayerTreeHostTestOccludedTileReleased
: public LayerTreeHostTestWithHelper { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestOccludedTileReleased);
class LayerTreeHostTestNoCommitDeadlock : public LayerTreeHostTest { … };
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoCommitDeadlock);
class LayerTreeHostTestDelayRecreateTiling
: public LayerTreeHostTestWithHelper { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDelayRecreateTiling);
class LayerTreeHostTestInvalidateImplSideForRerasterTiling
: public LayerTreeHostTestWithHelper { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestInvalidateImplSideForRerasterTiling);
class LayerTreeHostTestNeedsNotifyReadyToDrawAndActivate
: public LayerTreeHostTest { … };
class LayerTreeHostTestNeedsNotifyReadyToDrawOnly
: public LayerTreeHostTestNeedsNotifyReadyToDrawAndActivate { … };
SINGLE_THREAD_TEST_F(LayerTreeHostTestNeedsNotifyReadyToDrawOnly);
class LayerTreeHostTestNeedsNotifyReadyToActivateOnly
: public LayerTreeHostTestNeedsNotifyReadyToDrawAndActivate { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestNeedsNotifyReadyToActivateOnly);
class LayerTreeHostTestDidCommitAndDrawFrame : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDidCommitAndDrawFrame);
class LayerTreeHostTestBeginFramePausedChanged : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFramePausedChanged);
class LayerTreeHostUpdateViewportContainerSize : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostUpdateViewportContainerSize);
class LayerTreeHostTestForceRecreateTilingForLCDText
: public LayerTreeHostTestWithHelper { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestForceRecreateTilingForLCDText);
class LayerTreeHostTestDamagePropagatesFromViewTransitionSurface
: public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDamagePropagatesFromViewTransitionSurface);
class LayerTreeHostTestBlockOnCommitAfterInputEvent : public LayerTreeHostTest { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestBlockOnCommitAfterInputEvent);
class LayerTreeHostTestDetachInputDelegateAndRenderFrameObserver
: public LayerTreeTest,
StubInputHandlerClient { … };
MULTI_THREAD_TEST_F(LayerTreeHostTestDetachInputDelegateAndRenderFrameObserver);
}
}