chromium/cc/trees/layer_tree_host_impl_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "cc/trees/layer_tree_host_impl.h"

#include <stddef.h>

#include <cmath>
#include <memory>
#include <optional>
#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/angle_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "cc/animation/animation.h"
#include "cc/animation/animation_host.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/base/features.h"
#include "cc/base/histograms.h"
#include "cc/input/browser_controls_offset_manager.h"
#include "cc/input/input_handler.h"
#include "cc/input/main_thread_scrolling_reason.h"
#include "cc/input/page_scale_animation.h"
#include "cc/input/scroll_utils.h"
#include "cc/input/scrollbar_controller.h"
#include "cc/layers/append_quads_data.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/nine_patch_thumb_scrollbar_layer_impl.h"
#include "cc/layers/painted_scrollbar_layer_impl.h"
#include "cc/layers/render_surface_impl.h"
#include "cc/layers/solid_color_layer_impl.h"
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/layers/surface_layer_impl.h"
#include "cc/layers/video_layer_impl.h"
#include "cc/layers/viewport.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/resources/ui_resource_manager.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_frame_info.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_frame_sink.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_raster_source.h"
#include "cc/test/fake_recording_source.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/skia_common.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "cc/test/test_paint_worklet_layer_painter.h"
#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/clip_node.h"
#include "cc/trees/compositor_commit_data.h"
#include "cc/trees/draw_property_utils.h"
#include "cc/trees/effect_node.h"
#include "cc/trees/latency_info_swap_promise.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/mutator_host.h"
#include "cc/trees/render_frame_metadata.h"
#include "cc/trees/render_frame_metadata_observer.h"
#include "cc/trees/scroll_node.h"
#include "cc/trees/transform_node.h"
#include "cc/view_transition/view_transition_request.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/frame_timing_details.h"
#include "components/viz/common/quads/compositor_frame_metadata.h"
#include "components/viz/common/quads/compositor_render_pass_draw_quad.h"
#include "components/viz/common/quads/solid_color_draw_quad.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "components/viz/common/quads/tile_draw_quad.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "components/viz/common/surfaces/region_capture_bounds.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/fake_skia_output_surface.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "media/base/media.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
#include "ui/events/types/scroll_input_type.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/transform_operations.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
#include "ui/latency/latency_info.h"

#define EXPECT_SCOPED(statements)

VideoFrame;
_;
AnyNumber;
AtLeast;
Mock;
Range;
Return;
StrictMock;

ScrollThread;

namespace cc {
namespace {

constexpr gfx::Size kDefaultLayerSize(100, 100);

viz::SurfaceId MakeSurfaceId(const viz::FrameSinkId& frame_sink_id,
                             uint32_t parent_id) {}

struct TestFrameData : public LayerTreeHostImpl::FrameData {};

void ClearMainThreadDeltasForTesting(LayerTreeHostImpl* host) {}

}  // namespace

class LayerTreeHostImplTestBase : public testing::Test,
                                  public LayerTreeHostImplClient {};

CommitToPendingTreeLayerTreeHostImplTest;

class CommitToActiveTreeLayerTreeHostImplTest
    : public LayerTreeHostImplTestBase {};

class LayerTreeHostImplTest : public LayerTreeHostImplTestBase,
                              public testing::WithParamInterface<bool> {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

class OccludedSurfaceThrottlingLayerTreeHostImplTest
    : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

// A test fixture for new animation timelines tests.
class LayerTreeHostImplTimelinesTest : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

class FluentOverlayScrollbarLayerTreeHostImplTest
    : public CommitToPendingTreeLayerTreeHostImplTest {};

class FluentOverlayScrollbarOpacityLayerTreeHostImplTest
    : public FluentOverlayScrollbarLayerTreeHostImplTest,
      public testing::WithParamInterface<int> {};

class TestInputHandlerClient : public InputHandlerClient {};

TEST_P(LayerTreeHostImplTest, LocalAndExternalPinchState) {}

TEST_P(LayerTreeHostImplTest, NotifyIfCanDrawChanged) {}

TEST_P(LayerTreeHostImplTest, ResourcelessDrawWithEmptyViewport) {}

TEST_P(LayerTreeHostImplTest, ScrollDeltaNoLayers) {}

TEST_P(LayerTreeHostImplTest, ScrollDeltaTreeButNoChanges) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest, ScrollDeltaRepeatedScrolls) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest, SyncedScrollAbortedCommit) {}

// This test verifies that we drop a scroll (and don't crash) if a scroll is
// received before the root layer has been attached. https://crbug.com/895817.
TEST_P(LayerTreeHostImplTest, ScrollBeforeRootLayerAttached) {}

// Tests that receiving ScrollUpdate and ScrollEnd calls that don't have a
// matching ScrollBegin are just dropped and are a no-op. This can happen due
// to pre-commit input deferral which causes some input events to be dropped
// before the first commit in a renderer has occurred. See the flag
// kAllowPreCommitInput and how it's used.
TEST_P(LayerTreeHostImplTest, ScrollUpdateAndEndNoOpWithoutBegin) {}

// Test that specifying a scroller to ScrollBegin (i.e. avoid hit testing)
// returns the correct status if the scroller cannot be scrolled on the
// compositor thread.
TEST_P(LayerTreeHostImplTest, TargetMainThreadScroller) {}

TEST_P(LayerTreeHostImplTest, ScrollRootCallsCommitAndRedraw) {}

// Ensure correct semantics for the GetActivelyScrollingType method. This
// method is used to determine scheduler policy so it wants to report true only
// when real scrolling is occurring (i.e. the compositor is consuming scroll
// delta, the page isn't handling the events itself).
TEST_P(LayerTreeHostImplTest, ActivelyScrollingOnlyAfterScrollMovement) {}

TEST_P(LayerTreeHostImplTest, ScrollWithoutRootLayer) {}

TEST_P(LayerTreeHostImplTest, ScrollWithoutRenderer) {}

TEST_P(LayerTreeHostImplTest, ReplaceTreeWhileScrolling) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       ActivateTreeScrollingNodeDisappeared) {}

TEST_P(LayerTreeHostImplTest, ScrollBlocksOnWheelEventHandlers) {}

TEST_P(LayerTreeHostImplTest, ScrollBlocksOnTouchEventHandlers) {}

TEST_P(LayerTreeHostImplTest, ShouldScrollOnMainThread) {}

TEST_P(LayerTreeHostImplTest, ScrollWithOverlappingNonScrollableLayer) {}

TEST_P(LayerTreeHostImplTest,
       ScrollWithOverlappingTransparentNonScrollableLayer) {}

TEST_P(LayerTreeHostImplTest, ScrolledOverlappingDrawnScrollbarLayer) {}

gfx::PresentationFeedback ExampleFeedback() {}

class LayerTreeHostImplTestInvokePresentationCallbacks
    : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

// Tests that, when the LayerTreeHostImpl receives presentation feedback, the
// feedback gets routed to a properly registered callback.
TEST_P(LayerTreeHostImplTestInvokePresentationCallbacks,
       PresentationFeedbackCallbacksFire) {}

TEST_P(LayerTreeHostImplTest, MainThreadScrollHitTestRegionBasic) {}

TEST_P(LayerTreeHostImplTest, MainThreadScrollHitTestRegionInNonScrollingRoot) {}

TEST_P(LayerTreeHostImplTest, MainThreadScrollHitTestRegionWithOffset) {}

// Tests the following tricky case:
// - Scrolling Layer A with scrolling children:
//    - Ordinary Layer B with MainThreadScrollHitTestRegion
//    - Ordinary Layer C
//
//                   +---------+
//         +---------|         |+
//         | Layer A |         ||
//         |   +-----+-----+   ||
//         |   |  Layer C  |   ||
//         |   +-----+-----+   ||
//         |         | Layer B ||
//         +---------|         |+
//                   +---------+
//
//
// Both B and C scroll with A but overlap each other and C appears above B. If
// we try scrolling over C, we need to check if we intersect the NFSR on B
// because C may not be fully opaque to hit testing (e.g. the layer may be for
// |pointer-events:none| or be a squashing layer with "holes").
TEST_P(LayerTreeHostImplTest,
       LayerOverlapsMainThreadScrollHitTestRegionInLayer) {}

// Similar to the above test but this time layer B does not scroll with layer
// A. This is an edge case where the CSS painting algorithm allows a sibling of
// an overflow scroller to appear on top of the scroller itself but below some
// of the scroller's children. e.g. https://output.jsbin.com/tejulip/quiet.
//
// <div id="scroller" style="position:relative">
//   <div id="child" style="position:relative; z-index:2"></div>
// </div>
// <div id="sibling" style="position:absolute; z-index: 1"></div>
//
// So we setup:
//
// - Scrolling Layer A with scrolling child:
//    - Ordinary Layer C
// - Ordinary layer B with a MainThreadScrollHitTestRegion
//
//                   +---------+
//         +---------|         |+
//         | Layer A |         ||
//         |   +-----+-----+   ||
//         |   |  Layer C  |   ||
//         |   +-----+-----+   ||
//         |         | Layer B ||
//         +---------|         |+
//                   +---------+
//
//
// Only C scrolls with A but C appears above B. If we try scrolling over C, we
// need to check if we intersect the NFSR on B because C may not be fully
// opaque to hit testing (e.g. the layer may be for |pointer-events:none| or be
// a squashing layer with "holes").
TEST_P(LayerTreeHostImplTest,
       LayerOverlapsMainThreadScrollHitTestRegionInNonScrollAncestorLayer) {}

// - Scrolling Layer A with scrolling child:
//    - Ordinary Layer B with MainThreadScrollHitTestRegion
// - Fixed (scrolls with inner viewport) ordinary Layer C.
//
//         +---------+---------++
//         | Layer A |         ||
//         |   +-----+-----+   ||
//         |   |  Layer C  |   ||
//         |   +-----+-----+   ||
//         |         | Layer B ||
//         +---------+---------++
//
//
// B scrolls with A but C, which is fixed, appears above B. If we try scrolling
// over C, we need to check if we intersect the NFSR on B because C may not be
// fully opaque to hit testing (e.g. the layer may be for |pointer-events:none|
// or be a squashing layer with "holes"). This is similar to the cases above
// but uses a fixed Layer C to exercise the case where we hit the viewport via
// the inner viewport.
TEST_P(LayerTreeHostImplTest,
       FixedLayerOverlapsMainThreadScrollHitTestRegionInLayer) {}

// - Scrolling Layer A with scrolling child:
//    - Ordinary Layer B
// - Fixed (scrolls with inner viewport) ordinary Layer C.
//
//         +---------+---------++
//         | Layer A |         ||
//         |   +-----+-----+   ||
//         |   |  Layer C  |   ||
//         |   +-----+-----+   ||
//         |         | Layer B ||
//         +---------+---------++
//
//  This test simply ensures that a scroll over the region where layer C and
//  layer B overlap can be handled on the compositor thread. Both of these
//  layers have the viewport as the first scrolling ancestor but C has the
//  inner viewport while B has the outer viewport as an ancestor. Ensure we
//  treat these as equivalent.
TEST_P(LayerTreeHostImplTest, FixedLayerOverNonFixedLayer) {}

TEST_P(LayerTreeHostImplTest, ScrollHandlerNotPresent) {}

TEST_P(LayerTreeHostImplTest, ScrollHandlerPresent) {}

TEST_P(LayerTreeHostImplTest, ScrollUpdateReturnsCorrectValue) {}

// TODO(sunyunjia): Move scroll snap tests to a separate file.
// https://crbug.com/851690
TEST_P(LayerTreeHostImplTest, ScrollSnapOnX) {}

TEST_P(LayerTreeHostImplTest, ScrollSnapOnY) {}

TEST_P(LayerTreeHostImplTest, ScrollSnapOnBoth) {}

// Simulate a ScrollBegin and ScrollEnd without any intervening ScrollUpdate.
// This test passes if it doesn't crash.
TEST_P(LayerTreeHostImplTest, SnapAfterEmptyScroll) {}

TEST_P(LayerTreeHostImplTest, ScrollSnapAfterAnimatedScroll) {}

TEST_P(LayerTreeHostImplTest, SnapAnimationTargetUpdated) {}

TEST_P(LayerTreeHostImplTest, SnapAnimationCancelledByScroll) {}

TEST_P(LayerTreeHostImplTest,
       SnapAnimationShouldNotStartWhenScrollEndsAtSnapTarget) {}

TEST_P(LayerTreeHostImplTest,
       GetSnapFlingInfoAndSetAnimatingSnapTargetWhenZoomed) {}

TEST_P(LayerTreeHostImplTest, SnapFlingAnimationEndWithoutFinishing) {}

TEST_P(LayerTreeHostImplTest, NativeFlingInSnapArea) {}

TEST_P(LayerTreeHostImplTest, OverscrollBehaviorPreventsPropagation) {}

TEST_P(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) {}

// Test that if a scroll node doesn't have an associated Layer.
TEST_P(LayerTreeHostImplTest, ScrollNodeWithoutScrollLayer) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       AnimationSchedulingPendingTree) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       AnimationSchedulingActiveTree) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest,
       AnimationSchedulingCommitToActiveTree) {}

TEST_P(LayerTreeHostImplTest, AnimationSchedulingOnLayerDestruction) {}

class MissingTilesLayer : public LayerImpl {};

TEST_P(LayerTreeHostImplTest, ImplPinchZoom) {}

TEST_P(LayerTreeHostImplTest, ViewportScrollbarGeometry) {}

TEST_P(LayerTreeHostImplTest, ViewportScrollOrder) {}

// Make sure scrolls smaller than a unit applied to the viewport don't get
// dropped. crbug.com/539334.
TEST_P(LayerTreeHostImplTest, ScrollViewportWithFractionalAmounts) {}

// Tests that scrolls during a pinch gesture (i.e. "two-finger" scrolls) work
// as expected. That is, scrolling during a pinch should bubble from the inner
// to the outer viewport.
TEST_P(LayerTreeHostImplTest, ScrollDuringPinchGesture) {}

// Tests the "snapping" of pinch-zoom gestures to the screen edge. That is, when
// a pinch zoom is anchored within a certain margin of the screen edge, we
// should assume the user means to scroll into the edge of the screen.
TEST_P(LayerTreeHostImplTest, PinchZoomSnapsToScreenEdge) {}

TEST_P(LayerTreeHostImplTest, ImplPinchZoomWheelBubbleBetweenViewports) {}

TEST_P(LayerTreeHostImplTest, ScrollWithSwapPromises) {}

// Test that scrolls targeting a layer with a non-null scroll_parent() don't
// bubble up.
TEST_P(LayerTreeHostImplTest, ScrollDoesntBubble) {}

TEST_P(LayerTreeHostImplTest, PinchGesture) {}

TEST_P(LayerTreeHostImplTest, SyncSubpixelScrollDelta) {}

TEST_P(LayerTreeHostImplTest, SyncSubpixelScrollFromFractionalActiveBase) {}

TEST_P(LayerTreeHostImplTest, PinchZoomTriggersPageScaleAnimation) {}

TEST_P(LayerTreeHostImplTest, PageScaleAnimation) {}

TEST_P(LayerTreeHostImplTest, PageScaleAnimationNoOp) {}

TEST_P(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) {}

TEST_P(LayerTreeHostImplTest, PageScaleAnimationCompletedNotification) {}

TEST_P(LayerTreeHostImplTest, MaxScrollOffsetAffectedByViewportBoundsDelta) {}

// Ensures scroll gestures coming from scrollbars cause animations in the
// appropriate scenarios.
TEST_P(LayerTreeHostImplTest, AnimatedGranularityCausesSmoothScroll) {}

// Ensures scroll gestures coming from scrollbars don't cause animations if
// smooth scrolling is disabled.
TEST_P(LayerTreeHostImplTest, NonAnimatedGranularityCausesInstantScroll) {}

class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl {};

class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplTestScrollbarAnimation, Android) {}

TEST_P(LayerTreeHostImplTestScrollbarAnimation, AuraOverlay) {}

TEST_P(LayerTreeHostImplTestScrollbarAnimation, NoAnimator) {}

class LayerTreeHostImplTestScrollbarOpacity
    : public CommitToPendingTreeLayerTreeHostImplTest {};

TEST_F(LayerTreeHostImplTestScrollbarOpacity, Android) {}

TEST_F(LayerTreeHostImplTestScrollbarOpacity, AuraOverlay) {}

TEST_F(LayerTreeHostImplTestScrollbarOpacity, NoAnimator) {}

class LayerTreeHostImplTestMultiScrollable : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplTestMultiScrollable,
       ScrollbarFlashAfterAnyScrollUpdate) {}

TEST_P(LayerTreeHostImplTest, ScrollHitTestOnScrollbar) {}

// This test verifies that we don't crash when a scrollbar layer is hit for
// scroll but the scroller layer can't be found.
TEST_P(LayerTreeHostImplTest, NullScrollerLayerForScrollbarLayer) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       ScrollbarVisibilityChangeCausesRedrawAndCommit) {}

TEST_P(LayerTreeHostImplTest, ScrollbarInnerLargerThanOuter) {}

TEST_P(LayerTreeHostImplTest, ScrollbarRegistration) {}

TEST_P(LayerTreeHostImplTest, ScrollBeforeMouseMove) {}

void LayerTreeHostImplTestBase::SetupMouseMoveAtWithDeviceScale(
    float device_scale_factor) {}

TEST_P(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf1) {}

TEST_P(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf2) {}

// This test verifies that only SurfaceLayers in the viewport and have fallbacks
// that are different are included in viz::CompositorFrameMetadata's
// |activation_dependencies|.
TEST_P(LayerTreeHostImplTest, ActivationDependenciesInMetadata) {}

// Verify that updating the set of referenced surfaces for the active tree
// causes a new CompositorFrame to be submitted, even if there is no other
// damage.
TEST_P(LayerTreeHostImplTest, SurfaceReferencesChangeCausesDamage) {}

TEST_P(LayerTreeHostImplTest, CompositorFrameMetadata) {}

class DidDrawCheckLayer : public LayerImpl {};

TEST_P(LayerTreeHostImplTest, DamageShouldNotCareAboutContributingLayers) {}

TEST_P(LayerTreeHostImplTest, WillDrawReturningFalseDoesNotCall) {}

TEST_P(LayerTreeHostImplTest, DidDrawNotCalledOnHiddenLayer) {}

TEST_P(LayerTreeHostImplTest, WillDrawNotCalledOnOccludedLayer) {}

TEST_P(LayerTreeHostImplTest, DidDrawCalledOnAllLayers) {}

class MissingTextureAnimatingLayer : public DidDrawCheckLayer {};

struct PrepareToDrawSuccessTestCase {};

class LayerTreeHostImplPrepareToDrawTest : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplPrepareToDrawTest, PrepareToDrawSucceedsAndFails) {}

TEST_P(LayerTreeHostImplPrepareToDrawTest,
       PrepareToDrawWhenDrawAndSwapFullViewportEveryFrame) {}

TEST_P(LayerTreeHostImplTest, ScrollRootIgnored) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest, ClampingAfterActivation) {}

class LayerTreeHostImplBrowserControlsTest : public LayerTreeHostImplTest {};  // class LayerTreeHostImplBrowserControlsTest

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

#define EXPECT_VIEWPORT_GEOMETRIES(expected_browser_controls_shown_ratio)

// Tests that, on a page with content the same size as the viewport, hiding
// the browser controls also increases the ScrollableSize (i.e. the content
// size). Since the viewport got larger, the effective scrollable "content" also
// did. This ensures, for one thing, that the overscroll glow is shown in the
// right place.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       HidingBrowserControlsExpandsScrollableSize) {}

TEST_P(LayerTreeHostImplBrowserControlsTest,
       HidingBrowserControlsExpandsClipAncestorsOfReplacedOuterScroller) {}

TEST_P(LayerTreeHostImplBrowserControlsTest,
       HidingBrowserControlsAdjustsSnapFling) {}

// Ensure that moving the browser controls (i.e. omnibox/url-bar on mobile) on
// pages with a non-1 minimum page scale factor (e.g. legacy desktop page)
// correctly scales the clipping adjustment performed to show the newly exposed
// region of the page.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       MovingBrowserControlsOuterClipDeltaScaled) {}

// Tests that browser controls affect the position of horizontal scrollbars.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       HidingBrowserControlsAdjustsScrollbarPosition) {}

TEST_P(LayerTreeHostImplBrowserControlsTest,
       ScrollBrowserControlsByFractionalAmount) {}

// In this test, the outer viewport is initially unscrollable. We test that a
// scroll initiated on the inner viewport, causing the browser controls to show
// and thus making the outer viewport scrollable, still scrolls the outer
// viewport.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsOuterViewportBecomesScrollable) {}

// Test that the fixed position container delta is appropriately adjusted
// by the browser controls showing/hiding and page scale doesn't affect it.
TEST_P(LayerTreeHostImplBrowserControlsTest, FixedContainerDelta) {}

// Push a browser controls ratio from the main thread that we didn't send as a
// delta and make sure that the ratio is clamped to the [0, 1] range.
TEST_P(LayerTreeHostImplBrowserControlsTest, BrowserControlsPushUnsentRatio) {}

// Test that if a scrollable sublayer doesn't consume the scroll,
// browser controls should hide when scrolling down.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsScrollableSublayer) {}

// Ensure setting the browser controls position explicitly using the setters on
// the TreeImpl correctly affects the browser controls manager and viewport
// bounds for the active tree.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       PositionBrowserControlsToActiveTreeExplicitly) {}

// Ensure setting the browser controls position explicitly using the setters on
// the TreeImpl correctly affects the browser controls manager and viewport
// bounds for the pending tree.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       PositionBrowserControlsToPendingTreeExplicitly) {}

// Test that the top_controls delta and sent delta are appropriately
// applied on sync tree activation. The total browser controls offset shouldn't
// change after the activation.
TEST_P(LayerTreeHostImplBrowserControlsTest, ApplyDeltaOnTreeActivation) {}

// Test that changing the browser controls layout height is correctly applied to
// the inner viewport container bounds. That is, the browser controls layout
// height is the amount that the inner viewport container was shrunk outside
// the compositor to accommodate the browser controls.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsLayoutHeightChanged) {}

// Test that showing/hiding the browser controls when the viewport is fully
// scrolled doesn't incorrectly change the viewport offset due to clamping from
// changing viewport bounds.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsViewportOffsetClamping) {}

// Test that the browser controls coming in and out maintains the same aspect
// ratio between the inner and outer viewports.
TEST_P(LayerTreeHostImplBrowserControlsTest, BrowserControlsAspectRatio) {}

TEST_P(LayerTreeHostImplBrowserControlsTest, NoShrinkNotUserScrollable) {}

// Test that scrolling the outer viewport affects the browser controls.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsScrollOuterViewport) {}

TEST_P(LayerTreeHostImplBrowserControlsTest,
       ScrollNonScrollableRootWithBrowserControls) {}

// Tests that activating a pending tree while there's a bounds_delta on the
// viewport layers from browser controls doesn't cause a scroll jump. This bug
// was occurring because the UpdateViewportContainerSizes was being called
// before the property trees were updated with the bounds_delta.
// crbug.com/597266.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       ViewportBoundsDeltaOnTreeActivation) {}

TEST_P(LayerTreeHostImplTest, ScrollNonCompositedRoot) {}

TEST_P(LayerTreeHostImplTest, ScrollChildCallsCommitAndRedraw) {}

TEST_P(LayerTreeHostImplTest, ScrollMissesChild) {}

TEST_P(LayerTreeHostImplTest, ScrollMissesBackfacingChild) {}

TEST_P(LayerTreeHostImplTest, ScrollLayerWithMainThreadReason) {}

TEST_P(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnMainThread) {}

TEST_P(LayerTreeHostImplTest, ScrollRootAndChangePageScaleOnImplThread) {}

TEST_P(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) {}

TEST_P(LayerTreeHostImplTest, ScrollChildAndChangePageScaleOnMainThread) {}

TEST_P(LayerTreeHostImplTest, ScrollChildBeyondLimit) {}

TEST_P(LayerTreeHostImplTimelinesTest, ScrollAnimatedLatchToChild) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest, ScrollWithoutBubbling) {}

// Ensure that layers who's scroll parent is the InnerViewportScrollNode are
// still able to scroll on the compositor.
TEST_P(LayerTreeHostImplTest, ChildrenOfInnerScrollNodeCanScrollOnThread) {}

TEST_P(LayerTreeHostImplTest, ScrollEventBubbling) {}

TEST_P(LayerTreeHostImplTest, ScrollBeforeRedraw) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest, ScrollAxisAlignedRotatedLayer) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest,
       ScrollNonAxisAlignedRotatedLayer) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest,
       ScrollPerspectiveTransformedLayer) {}

TEST_F(CommitToActiveTreeLayerTreeHostImplTest, ScrollScaledLayer) {}

TEST_P(LayerTreeHostImplTest, ScrollViewportRounding) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       RootLayerScrollOffsetDelegation) {}

void CheckLayerScrollOffset(LayerImpl* layer, gfx::Point scroll_offset) {}

TEST_P(LayerTreeHostImplTest,
       ExternalRootLayerScrollOffsetDelegationReflectedInNextDraw) {}

// Ensure the viewport correctly handles the user_scrollable bits. That is, if
// the outer viewport disables user scrolling, we should still be able to
// scroll the inner viewport.
TEST_P(LayerTreeHostImplTest, ViewportUserScrollable) {}

// Ensure that the SetSynchronousInputHandlerRootScrollOffset method used by
// the WebView API correctly respects the user_scrollable bits on both of the
// inner and outer viewport scroll nodes.
TEST_P(LayerTreeHostImplTest, SetRootScrollOffsetUserScrollable) {}

// The SetSynchronousInputHandlerRootScrollOffset API can be called while there
// is no inner viewport set. This test passes if we don't crash.
TEST_P(LayerTreeHostImplTest, SetRootScrollOffsetNoViewportCrash) {}

TEST_P(LayerTreeHostImplTest, OverscrollRoot) {}

TEST_P(LayerTreeHostImplTest, OverscrollChildWithoutBubbling) {}

TEST_P(LayerTreeHostImplTest, OverscrollChildEventBubbling) {}

TEST_P(LayerTreeHostImplTest, OverscrollAlways) {}

TEST_P(LayerTreeHostImplTest, NoOverscrollWhenNotAtEdge) {}

TEST_P(LayerTreeHostImplTest, NoOverscrollOnNonViewportLayers) {}

// Test that scrolling the inner viewport directly works, as can happen when the
// scroll chains up to it from an sibling of the outer viewport.
TEST_P(LayerTreeHostImplTest, ScrollFromOuterViewportSibling) {}

// Test that scrolls chain correctly when a child scroller on the page (e.g. a
// scrolling div) is set as the outer viewport. This happens in the
// rootScroller proposal.
TEST_P(LayerTreeHostImplTest, ScrollChainingWithReplacedOuterViewport) {}

// Test that scrolls chain correctly when a child scroller on the page (e.g. a
// scrolling div) is set as the outer viewport but scrolls start from a layer
// that's not a descendant of the outer viewport. This happens in the
// rootScroller proposal.
TEST_P(LayerTreeHostImplTest, RootScrollerScrollNonDescendant) {}

TEST_P(LayerTreeHostImplTest, OverscrollOnImplThread) {}

class BlendStateCheckLayer : public LayerImpl {};

TEST_P(LayerTreeHostImplTest, BlendingOffWhenDrawingOpaqueLayers) {}

static bool MayContainVideoBitSetOnFrameData(LayerTreeHostImpl* host_impl) {}

TEST_P(LayerTreeHostImplTest, MayContainVideo) {}

TEST_P(LayerTreeHostImplTest, MayThrottleIfUnusedFrames) {}

class LayerTreeHostImplViewportCoveredTest
    : public CommitToPendingTreeLayerTreeHostImplTest {};

TEST_F(LayerTreeHostImplViewportCoveredTest, ViewportCovered) {}

TEST_F(LayerTreeHostImplViewportCoveredTest, ViewportCoveredScaled) {}

TEST_F(LayerTreeHostImplViewportCoveredTest, ActiveTreeGrowViewportInvalid) {}

TEST_F(LayerTreeHostImplViewportCoveredTest, ActiveTreeShrinkViewportInvalid) {}

class FakeDrawableLayerImpl : public LayerImpl {};

// Make sure damage tracking propagates all the way to the viz::CompositorFrame
// submitted to the LayerTreeFrameSink, where it should request to swap only
// the sub-buffer that is damaged.
TEST_P(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) {}

TEST_P(LayerTreeHostImplTest, RootLayerDoesntCreateExtraSurface) {}

class FakeLayerWithQuads : public LayerImpl {};

TEST_P(LayerTreeHostImplTest, LayersFreeTextures) {}

TEST_P(LayerTreeHostImplTest, HasTransparentBackground) {}

class LayerTreeHostImplTestDrawAndTestDamage : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplTestDrawAndTestDamage, FrameIncludesDamageRect) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest, FarAwayQuadsDontNeedAA) {}

class CompositorFrameMetadataTest : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(CompositorFrameMetadataTest, CompositorFrameAckCountsAsSwapComplete) {}

class CountingSoftwareDevice : public viz::SoftwareOutputDevice {};

TEST_P(LayerTreeHostImplTest,
       ForcedDrawToSoftwareDeviceSkipsUnsupportedLayers) {}

// Checks that we use the memory limits provided.
TEST_P(LayerTreeHostImplTest, MemoryLimits) {}

namespace {
void ExpectFullDamageAndDraw(LayerTreeHostImpl* host_impl) {}
}  // namespace

TEST_P(LayerTreeHostImplTestDrawAndTestDamage,
       RequireHighResAndRedrawWhenVisible) {}

class LayerTreeHostImplTestPrepareTiles : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplTestPrepareTiles, PrepareTilesWhenInvisible) {}

TEST_P(LayerTreeHostImplTest, UIResourceManagement) {}

TEST_P(LayerTreeHostImplTest, CreateETC1UIResource) {}

// This tests the case where hit testing only on scrollable layers returns a
// layer that's outside the scroll chain of the first hit test *any* layer. See
// LayerTreeHostImpl::IsInitialScrollHitTestReliable for details.
TEST_P(LayerTreeHostImplTest, ScrollHitTestIsNotReliable) {}

// Similar but different case to above. See
// LayerTreeHostImpl::IsInitialScrollHitTestReliable for details.
TEST_P(LayerTreeHostImplTest, ScrollHitTestAncestorMismatch) {}

TEST_P(LayerTreeHostImplTest, ScrollInvisibleScroller) {}

// Make sure LatencyInfo carried by LatencyInfoSwapPromise are passed
// in viz::CompositorFrameMetadata.
TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       LatencyInfoPassedToCompositorFrameMetadata) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       CompositorFrameMetadataFrameIntervalInputs) {}

#if BUILDFLAG(IS_ANDROID)
TEST_P(LayerTreeHostImplTest, SelectionBoundsPassedToCompositorFrameMetadata) {
  LayerImpl* root = SetupRootLayer<SolidColorLayerImpl>(
      host_impl_->active_tree(), gfx::Size(10, 10));
  UpdateDrawProperties(host_impl_->active_tree());

  // Plumb the layer-local selection bounds.
  gfx::Point selection_start(5, 0);
  gfx::Point selection_end(5, 5);
  LayerSelection selection;
  selection.start.type = gfx::SelectionBound::CENTER;
  selection.start.layer_id = root->id();
  selection.start.edge_end = selection_end;
  selection.start.edge_start = selection_start;
  selection.end = selection.start;
  host_impl_->active_tree()->RegisterSelection(selection);

  host_impl_->SetNeedsRedraw();
  RenderFrameMetadata metadata = StartDrawAndProduceRenderFrameMetadata();

  // Ensure the selection bounds have propagated to the frame metadata.
  const viz::Selection<gfx::SelectionBound>& selection_after =
      metadata.selection;
  EXPECT_EQ(selection.start.type, selection_after.start.type());
  EXPECT_EQ(selection.end.type, selection_after.end.type());
  EXPECT_EQ(gfx::PointF(selection_end), selection_after.start.edge_end());
  EXPECT_EQ(gfx::PointF(selection_start), selection_after.start.edge_start());
  EXPECT_TRUE(selection_after.start.visible());
  EXPECT_TRUE(selection_after.end.visible());
}

TEST_P(LayerTreeHostImplTest, HiddenSelectionBoundsStayHidden) {
  LayerImpl* root = SetupDefaultRootLayer(gfx::Size(10, 10));

  UpdateDrawProperties(host_impl_->active_tree());

  // Plumb the layer-local selection bounds.
  gfx::Point selection_start(5, 0);
  gfx::Point selection_end(5, 5);
  LayerSelection selection;

  // Mark the start as hidden.
  selection.start.hidden = true;

  selection.start.type = gfx::SelectionBound::CENTER;
  selection.start.layer_id = root->id();
  selection.start.edge_end = selection_end;
  selection.start.edge_start = selection_start;
  selection.end = selection.start;
  host_impl_->active_tree()->RegisterSelection(selection);

  host_impl_->SetNeedsRedraw();
  RenderFrameMetadata metadata = StartDrawAndProduceRenderFrameMetadata();

  // Ensure the selection bounds have propagated to the frame metadata.
  const viz::Selection<gfx::SelectionBound>& selection_after =
      metadata.selection;
  EXPECT_EQ(selection.start.type, selection_after.start.type());
  EXPECT_EQ(selection.end.type, selection_after.end.type());
  EXPECT_EQ(gfx::PointF(selection_end), selection_after.start.edge_end());
  EXPECT_EQ(gfx::PointF(selection_start), selection_after.start.edge_start());
  EXPECT_FALSE(selection_after.start.visible());
  EXPECT_FALSE(selection_after.end.visible());
}
#endif  // BUILDFLAG(IS_ANDROID)

TEST_P(LayerTreeHostImplTest, SimpleSwapPromiseMonitor) {}

class LayerTreeHostImplWithBrowserControlsTest : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

const int LayerTreeHostImplWithBrowserControlsTest::top_controls_height_ =;

TEST_P(LayerTreeHostImplWithBrowserControlsTest, NoIdleAnimations) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsHeightIsCommitted) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsStayFullyVisibleOnHeightChange) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsAnimationScheduling) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       ScrollHandledByBrowserControls) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       WheelUnhandledByBrowserControls) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsAnimationAtOrigin) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsAnimationAfterScroll) {}

TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       BrowserControlsScrollDeltaInOverScroll) {}

// Tests that when animating the top controls down, the viewport doesn't counter
// scroll if it's not already scrolled.
TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       AnimationDoesntScrollUnscrolledViewport) {}

// Tests that when animating the top controls down, the viewport counter scrolls
// if it's partially scrolled down.
TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       AnimationScrollsScrolledViewport) {}

// Tests that the page animates down with the top controls when
// BrowserControlParams.only_expand_top_controls_at_page_top is true.
TEST_P(LayerTreeHostImplWithBrowserControlsTest,
       AnimationScrollsViewportWhenOnlyExpandTopControlsAtPageTopIsSet) {}

// Tests that when we set a child scroller (e.g. a scrolling div) as the outer
// viewport, scrolling it controls the browser controls.
TEST_P(LayerTreeHostImplBrowserControlsTest,
       ReplacedOuterViewportScrollsBrowserControls) {}

TEST_P(LayerTreeHostImplTest, RootScrollBothInnerAndOuterLayer) {}

TEST_P(LayerTreeHostImplTest, DiagonalScrollBubblesPerfectlyToInner) {}

TEST_P(LayerTreeHostImplTest,
       ScrollBeginEventThatTargetsViewportLayerSkipsHitTest) {}

TEST_P(LayerTreeHostImplTest, NoOverscrollWhenInnerViewportCantScroll) {}

class LayerTreeHostImplWithImplicitLimitsTest : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

TEST_P(LayerTreeHostImplWithImplicitLimitsTest, ImplicitMemoryLimits) {}

TEST_P(LayerTreeHostImplTest, ExternalTransformReflectedInNextDraw) {}

TEST_P(LayerTreeHostImplTest, ExternalTransformSetNeedsRedraw) {}

TEST_P(LayerTreeHostImplTest, OnMemoryPressure) {}

TEST_P(LayerTreeHostImplTest, OnDrawConstraintSetNeedsRedraw) {}

// This test verifies that the viewport damage rect is the full viewport and not
// just part of the viewport in the presence of an external viewport.
TEST_P(LayerTreeHostImplTest, FullViewportDamageAfterOnDraw) {}

class ResourcelessSoftwareLayerTreeHostImplTest
    : public CommitToPendingTreeLayerTreeHostImplTest {};

TEST_F(ResourcelessSoftwareLayerTreeHostImplTest,
       ResourcelessSoftwareSetNeedsRedraw) {}

TEST_F(ResourcelessSoftwareLayerTreeHostImplTest,
       ResourcelessSoftwareDrawSkipsUpdateTiles) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       ExternalTileConstraintReflectedInPendingTree) {}

TEST_P(LayerTreeHostImplTest, ExternalViewportAffectsVisibleRects) {}

TEST_P(LayerTreeHostImplTest, ExternalTransformAffectsVisibleRects) {}

TEST_P(LayerTreeHostImplTest, ExternalTransformAffectsSublayerScaleFactor) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest, OneScrollForFirstScrollDelay) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       OtherInputsForFirstScrollDelay) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       MultipleScrollsForFirstScrollDelay) {}

TEST_P(LayerTreeHostImplTest, ScrollAnimated) {}

// Tests latching behavior, in particular when a ScrollEnd is received but a
// new ScrollBegin is received before the animation from the previous gesture
// stream is finished.
TEST_P(LayerTreeHostImplTest, ScrollAnimatedLatching) {}

// Test to ensure that animated scrolls correctly account for the page scale
// factor. That is, if you zoom into the page, a wheel scroll should scroll the
// content *less* than before so that it appears to move the same distance when
// zoomed in.
TEST_P(LayerTreeHostImplTest, ScrollAnimatedWhileZoomed) {}

// Ensures a scroll updating an in progress animation works correctly when the
// inner viewport is animating. Specifically this test makes sure the animation
// update doesn't get confused between the currently scrolling node and the
// currently animating node which are different. See https://crbug.com/1070561.
TEST_P(LayerTreeHostImplTest, ScrollAnimatedUpdateInnerViewport) {}

// Fluent Overlay Scrollbars track opacity is scaled depending on the thickness
// scale factor of the scrollbar's thumb. When the thumb's thickness is at it's
// minimum the track should be invisible
// (`thickness_scale_factor_` == `kIdleThicknessScale`) => (`opacity_` == 0).
// When the thumb's thickness is at it's maximum, the track should be fully
// visible.
// (`thickness_scale_factor_` == 1) => (`opacity_` == 1).
// For every thickness value in between `kIdleThicknessScale` and 1.f the
// opacity should be scaled appropriately This test ensures the correlation
// between thickness of the thumb and opacity of the track.
TEST_P(FluentOverlayScrollbarOpacityLayerTreeHostImplTest,
       PaintedOverlayScrollbarTrackOpacityTest) {}

INSTANTIATE_TEST_SUITE_P();

TEST_F(FluentOverlayScrollbarLayerTreeHostImplTest,
       FluentScrollbarFlashAfterScrollUpdate) {}

// Fluent Overlay Scrollbars opacity should be set to zero when creating
// the animation controller.
TEST_F(FluentOverlayScrollbarLayerTreeHostImplTest,
       PaintedOverlayLayerOnLoadOpacityTest) {}

// Fluent Overlay Scrollbar should not be hit tested when it's opacity is zero.
TEST_F(FluentOverlayScrollbarLayerTreeHostImplTest,
       DoesntGetHitTestedWhenInvisible) {}

// This tests that faded-out Aura scrollbars can't be interacted with.
TEST_P(LayerTreeHostImplTest, FadedOutPaintedOverlayScrollbarHitTest) {}

// Tests that no scrolls occur when thumb_len equals track_len.
TEST_P(LayerTreeHostImplTest, ScrollOnLargeThumb) {}

// Tests that deleting a horizontal scrollbar doesn't affect the autoscroll task
// for the vertical scrollbar.
TEST_P(LayerTreeHostImplTest, AutoscrollOnDeletedScrollbar) {}

// Tests that a pointerdown followed by pointermove(s) produces
// InputHandlerPointerResult with scroll_offset > 0 even though the GSB might
// have been dispatched *after* the first pointermove was handled by the
// ScrollbarController.
TEST_P(LayerTreeHostImplTest, PointerMoveOutOfSequence) {}

// This tests that faded-out Mac scrollbars can't be interacted with.
TEST_P(LayerTreeHostImplTest, FadedOutPaintedScrollbarHitTest) {}

TEST_P(LayerTreeHostImplTest, SingleGSUForScrollbarThumbDragPerFrame) {}

// Test if the AverageLagTrackingManager's pending frames list is cleared when
// the LayerTreeFrameSink loses context. It is necessary since the frames won't
// receive a presentation feedback if the context is lost, and the pending
// frames will never be removed from the list otherwise.
TEST_P(LayerTreeHostImplTest,
       ClearTrackingManagerOnLayerTreeFrameSinkLoseContext) {}

// Test that DroppedFrameCounter and TotalFrameCounter reset themselves under
// certain conditions
TEST_P(LayerTreeHostImplTest, FrameCounterReset) {}

// Test that DroppedFrameCounter and TotalFrameCounter do not reset themselves
// under certain conditions
TEST_P(LayerTreeHostImplTest, FrameCounterNotReset) {}

// Tests that the scheduled autoscroll task aborts if a 2nd mousedown occurs in
// the same frame.
TEST_P(LayerTreeHostImplTest, AutoscrollTaskAbort) {}

// Tests that the ScrollbarController handles jump clicks.
TEST_P(LayerTreeHostImplTest, JumpOnScrollbarClick) {}

// Tests that a thumb drag continues to function as expected after a jump click.
// The functionality of thumb drag itself is pretty well tested. So all that
// this test needs to verify is that the thumb drag_state_ is correctly
// populated.
TEST_P(LayerTreeHostImplTest, ThumbDragAfterJumpClick) {}

// Tests that an existing scroll offset animation (for a scrollbar) is aborted
// before a new one is created.
TEST_P(LayerTreeHostImplTest, AbortAnimatedScrollBeforeStartingAutoscroll) {}

// Tests that an animated scrollbar scroll aborts when a different device (like
// a mousewheel) wants to animate the scroll offset.
TEST_P(LayerTreeHostImplTest, AnimatedScrollYielding) {}

// Tests that changing the scroller length in the middle of a thumb drag doesn't
// cause the scroller to jump.
TEST_P(LayerTreeHostImplTest, ThumbDragScrollerLengthIncrease) {}

TEST_P(LayerTreeHostImplTest, MainThreadFallback) {}

TEST_P(LayerTreeHostImplTest, SecondScrollAnimatedBeginNotIgnored) {}

// Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets
// called before the animation is started.
TEST_P(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) {}

TEST_P(LayerTreeHostImplTest, ScrollAnimatedWithDelay) {}

// Test that a smooth scroll offset animation is aborted when followed by a
// non-smooth scroll offset animation.
TEST_P(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) {}

// Evolved from LayerTreeHostImplTest.ScrollAnimated.
TEST_P(LayerTreeHostImplTimelinesTest, ScrollAnimated) {}

// Test that the scroll delta for an animated scroll is distributed correctly
// between the inner and outer viewport.
TEST_P(LayerTreeHostImplTimelinesTest, ImplPinchZoomScrollAnimated) {}

// Test that the correct viewport scroll layer is updated when the target offset
// is updated.
TEST_P(LayerTreeHostImplTimelinesTest, ImplPinchZoomScrollAnimatedUpdate) {}

// Test that smooth scroll offset animation doesn't happen for non user
// scrollable layers.
TEST_P(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) {}

// Test that smooth scrolls clamp correctly when bounds change mid-animation.
TEST_P(LayerTreeHostImplTimelinesTest, ScrollAnimatedChangingBounds) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       InvalidLayerNotAddedToRasterQueue) {}

TEST_F(CommitToPendingTreeLayerTreeHostImplTest, DidBecomeActive) {}

TEST_P(LayerTreeHostImplTest, WheelScrollWithPageScaleFactorOnInnerLayer) {}

class LayerTreeHostImplCountingLostSurfaces : public LayerTreeHostImplTest {};

INSTANTIATE_COMMIT_TO_TREE_TEST_P();

// We do not want to reset context recovery state when we get repeated context
// loss notifications via different paths.
TEST_P(LayerTreeHostImplCountingLostSurfaces, TwiceLostSurface) {}

size_t CountRenderPassesWithId(const viz::CompositorRenderPassList& list,
                               viz::CompositorRenderPassId id) {}

TEST_P(LayerTreeHostImplTest, RemoveUnreferencedRenderPass) {}

TEST_P(LayerTreeHostImplTest, RemoveEmptyRenderPass) {}TEST_P(LayerTreeHostImplTest, DoNotRemoveEmptyRootRenderPass) {}class FakeVideoFrameController : public VideoFrameController {}TEST_P(LayerTreeHostImplTest, AddVideoFrameControllerInsideFrame) {}TEST_P(LayerTreeHostImplTest, AddVideoFrameControllerOutsideFrame) {}class GpuRasterizationDisabledLayerTreeHostImplTest
    : public LayerTreeHostImplTest {}class MsaaIsSlowLayerTreeHostImplTest
    : public CommitToActiveTreeLayerTreeHostImplTest {}TEST_F(MsaaIsSlowLayerTreeHostImplTest, GpuRasterizationStatusMsaaIsSlow) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       UpdatePageScaleFactorOnActiveTree) {}TEST_P(LayerTreeHostImplTest, SubLayerScaleForNodeInSubtreeOfPageScaleLayer) {}TEST_P(LayerTreeHostImplTest, RecomputeGpuRasterOnLayerTreeFrameSinkChange) {}void LayerTreeHostImplTestBase::SetupMouseMoveAtTestScrollbarStates(
    bool main_thread_scrolling) {}TEST_P(LayerTreeHostImplTest,
       LayerTreeHostImplTestScrollbarStatesInMainThreadScrolling) {}TEST_P(LayerTreeHostImplTest,
       LayerTreeHostImplTestScrollbarStatesInNotMainThreadScrolling) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       CheckerImagingTileInvalidation) {}TEST_P(LayerTreeHostImplTest, RasterColorSpace) {}TEST_P(LayerTreeHostImplTest, RasterColorSpaceSoftware) {}TEST_P(LayerTreeHostImplTest, RasterColorPrefersSRGB) {}TEST_P(LayerTreeHostImplTest, RasterColorSpaceHDR) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       UpdatedTilingsForNonDrawingLayers) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       RasterTilePrioritizationForNonDrawingLayers) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       DrawAfterDroppingTileResources) {}TEST_P(LayerTreeHostImplTest, AllowedTouchActionTest1) {}TEST_P(LayerTreeHostImplTest, AllowedTouchActionTest2) {}TEST_P(LayerTreeHostImplTest, AllowedTouchActionTest3) {}TEST_P(LayerTreeHostImplTest, AllowedTouchActionTest4) {}class TestRenderFrameMetadataObserver : public RenderFrameMetadataObserver {}TEST_P(LayerTreeHostImplTest, RenderFrameMetadata) {}TEST_P(LayerTreeHostImplTest, SelectionBoundsPassedToRenderFrameMetadata) {}TEST_P(LayerTreeHostImplTest,
       VerticalScrollDirectionChangesPassedToRenderFrameMetadata) {}TEST_P(LayerTreeHostImplTest, ScrollUpdateDoesNotSetScrollingNode) {}class HitTestRegionListGeneratingLayerTreeHostImplTest
    : public LayerTreeHostImplTest {}INSTANTIATE_COMMIT_TO_TREE_TEST_P()TEST_P(HitTestRegionListGeneratingLayerTreeHostImplTest, BuildHitTestData) {}TEST_P(HitTestRegionListGeneratingLayerTreeHostImplTest, PointerEvents) {}TEST_P(HitTestRegionListGeneratingLayerTreeHostImplTest, ComplexPage) {}TEST_P(HitTestRegionListGeneratingLayerTreeHostImplTest, InvalidFrameSinkId) {}TEST_P(LayerTreeHostImplTest, ImplThreadPhaseUponImplSideInvalidation) {}TEST_P(LayerTreeHostImplTest, SkipOnDrawDoesNotUpdateDrawParams) {}TEST_P(LayerTreeHostImplTest, TouchScrollOnAndroidScrollbar) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       CommitWithNoPaintWorkletLayerPainter) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest, CommitWithNoPaintWorklets) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest, CommitWithDirtyPaintWorklets) {}TEST_F(CommitToPendingTreeLayerTreeHostImplTest,
       CommitWithNoDirtyPaintWorklets) {}class ForceActivateAfterPaintWorkletPaintLayerTreeHostImplTest
    : public CommitToPendingTreeLayerTreeHostImplTest {}TEST_F(ForceActivateAfterPaintWorkletPaintLayerTreeHostImplTest,
       ForceActivationAfterPaintWorkletsFinishPainting) {}TEST_P(LayerTreeHostImplTest, PercentBasedScrollbarDeltasDSF3) {}TEST_P(LayerTreeHostImplTest, PageBasedScroll) {}class UnifiedScrollingTest : public LayerTreeHostImplTest {}INSTANTIATE_COMMIT_TO_TREE_TEST_P()TEST_P(UnifiedScrollingTest, UnifiedScrollMainThreadScrollHitTestRegion) {}TEST_P(UnifiedScrollingTest, MainThreadHitTestLatchBubbling) {}UnifiedScrollingDeathTestINSTANTIATE_COMMIT_TO_TREE_TEST_P()TEST_P(UnifiedScrollingDeathTest, EmptyMainThreadHitTest) {}TEST_P(UnifiedScrollingTest, MainThreadHitTestScrollNodeNotFound) {}TEST_P(UnifiedScrollingTest, NonCompositedScrollOnCompositor) {}TEST_P(UnifiedScrollingTest,
       LayerMixedHitTestOpaquenessCausesMainThreadHitTest) {}TEST_P(UnifiedScrollingTest,
       LayerMixedHitTestOpaquenessCausesMainThreadHitTest2) {}TEST_P(UnifiedScrollingTest, LayerOpaqueToHitTestScrollsOnCompositor) {}TEST_P(UnifiedScrollingTest, FixedLayerOpaqueToHitTestScrollsOnCompositor) {}TEST_P(UnifiedScrollingTest,
       LayerOpaqueToHitTestEscapingScrollersWithMixedToHitTestLayers) {}TEST_P(UnifiedScrollingTest,
       ReliableScrollHitTestWithOpaqueAndMixedToHitTestLayers) {}TEST_P(UnifiedScrollingTest, MainThreadScrollingReasonsScrollOnCompositor) {}TEST_P(UnifiedScrollingTest, UnreliableHitTestOnNonOpaqueToHitTestScroller) {}TEST_P(UnifiedScrollingTest, ScrollbarLayerClippedByRoundedCorner) {}void UnifiedScrollingTest::TestNonCompositedScrollingState(
    bool mutates_transform_tree) {}TEST_P(UnifiedScrollingTest, MainThreadReasonsScrollDoesntAffectTransform) {}TEST_P(UnifiedScrollingTest, NonCompositedScrollerDoesntAffectTransform) {}TEST_P(UnifiedScrollingTest, CompositedWithSquashedLayerMutatesTransform) {}TEST_P(OccludedSurfaceThrottlingLayerTreeHostImplTest,
       ThrottleOccludedSurface) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestSimple) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestInheritance) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestOverlap) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestOverlapSimpleClip) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestOverlapRoundedCorners) {}TEST_P(LayerTreeHostImplTest, FrameElementIdHitTestOverlapSibling) {}TEST_P(LayerTreeHostImplTest, ViewTransitionRequestCausesDamage) {}TEST_P(LayerTreeHostImplTest, CollectRegionCaptureBounds) {}TEST_P(LayerTreeHostImplTest, RecomputeRasterCapsOnLayerTreeFrameSinkUpdate) {}TEST_P(LayerTreeHostImplBrowserControlsTest,
       BrowserControlsActivelyScrollingType) {}TEST_P(LayerTreeHostImplTest, AnimatedScrollSnapStrategyCurrentOffset) {}TEST_P(LayerTreeHostImplTest, NonAnimatedScrollSnapStrategyCurrentOffset) {}TEST_P(LayerTreeHostImplTest, AnimatedViewportScrollSnapStrategyCurrentOffset) {}TEST_P(LayerTreeHostImplTest,
       NonAnimatedViewportScrollSnapStrategyCurrentOffset) {}TEST_P(LayerTreeHostImplTest, FlingSnapStrategyCurrentOffset) {}class FakeLayerImpl : public LayerImpl {}TEST_P(LayerTreeHostImplTest, VisbilityUpdateToLayers) {}