chromium/third_party/blink/renderer/core/frame/local_frame_view_test.cc

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

#include "third_party/blink/renderer/core/frame/local_frame_view.h"

#include <memory>

#include "base/test/scoped_feature_list.h"
#include "base/test/with_feature_override.h"
#include "content/test/test_blink_web_unit_test_support.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/scroll/scrollbar_mode.mojom-blink.h"
#include "third_party/blink/renderer/core/css/css_style_declaration.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/media_type_names.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/paint/paint_property_tree_printer.h"
#include "third_party/blink/renderer/core/paint/timing/paint_timing.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_artifact.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "ui/gfx/geometry/size.h"

RunPendingTasks;
_;

namespace blink {
namespace {

class AnimationMockChromeClient : public RenderingTestChromeClient {};

class LocalFrameViewTest : public RenderingTest {};

TEST_F(LocalFrameViewTest, SetPaintInvalidationDuringUpdateAllLifecyclePhases) {}

TEST_F(LocalFrameViewTest,
       SetPaintInvalidationDuringUpdateLifecyclePhasesToPrePaintClean) {}

TEST_F(LocalFrameViewTest, SetPaintInvalidationOutOfUpdateAllLifecyclePhases) {}

// If we don't hide the tooltip on scroll, it can negatively impact scrolling
// performance. See crbug.com/586852 for details.
TEST_F(LocalFrameViewTest, HideTooltipWhenScrollPositionChanges) {}

// NoOverflowInIncrementVisuallyNonEmptyPixelCount tests fail if the number of
// pixels is calculated in 32-bit integer, because 65536 * 65536 would become 0
// if it was calculated in 32-bit and thus it would be considered as empty.
TEST_F(LocalFrameViewTest, NoOverflowInIncrementVisuallyNonEmptyPixelCount) {}

TEST_F(LocalFrameViewTest, UpdateLifecyclePhasesForPrintingDetachedFrame) {}

TEST_F(LocalFrameViewTest, PrintFrameUpdateAllLifecyclePhases) {}

TEST_F(LocalFrameViewTest, CanHaveScrollbarsIfScrollingAttrEqualsNoChanged) {}

TEST_F(LocalFrameViewTest,
       MainThreadScrollingForBackgroundFixedAttachmentWithCompositing) {}

TEST_F(LocalFrameViewTest,
       MainThreadScrollingForBackgroundFixedAttachmentWithoutCompositing) {}

class LocalFrameViewSimTest : public SimTest {};

// Ensure the fragment navigation "scroll into view and focus" behavior doesn't
// activate synchronously while rendering is blocked waiting on a stylesheet.
// See https://crbug.com/851338.
TEST_F(LocalFrameViewSimTest, FragmentNavChangesFocusWhileRenderingBlocked) {}

TEST_F(LocalFrameViewSimTest, ForcedLayoutWithIncompleteSVGChildFrame) {}

TEST_F(LocalFrameViewTest, TogglePaintEligibility) {}

TEST_F(LocalFrameViewTest, WillNotBlockCommitsForNonMainFrames) {}

TEST_F(LocalFrameViewTest, IsUpdatingLifecycle) {}

TEST_F(LocalFrameViewSimTest, PaintEligibilityNoSubframe) {}

TEST_F(LocalFrameViewSimTest, SameOriginPaintEligibility) {}

TEST_F(LocalFrameViewSimTest, CrossOriginPaintEligibility) {}

TEST_F(LocalFrameViewSimTest, NestedCrossOriginPaintEligibility) {}

class LocalFrameViewRemoteParentSimTest : public LocalFrameViewSimTest {};

TEST_F(LocalFrameViewRemoteParentSimTest, ThrottledLocalRootAnimationUpdate) {}

class TestLifecycleObserver
    : public GarbageCollected<TestLifecycleObserver>,
      public LocalFrameView::LifecycleNotificationObserver {};

TEST_F(LocalFrameViewTest, LifecycleNotificationsOnlyOnFullLifecycle) {}

TEST_F(LocalFrameViewTest, StartOfLifecycleTaskRunsOnFullLifecycle) {}

TEST_F(LocalFrameViewTest, DarkModeDocumentBackground) {}

TEST_F(LocalFrameViewTest,
       AdjustMediaTypeForPrintingRestoresMediaTypeCorrectly) {}

class FencedFrameLocalFrameViewTest : private ScopedFencedFramesForTest,
                                      public SimTest {};

TEST_F(FencedFrameLocalFrameViewTest, DoNotDeferCommitsInFencedFrames) {}

class ResizableLocalFrameViewTest : public testing::Test {};

TEST_F(ResizableLocalFrameViewTest, FocusedElementStaysOnResizeWithCQ) {}

class PrerenderLocalFrameViewTest : public base::test::WithFeatureOverride,
                                    public SimTest {};

INSTANTIATE_FEATURE_OVERRIDE_TEST_SUITE();

TEST_P(PrerenderLocalFrameViewTest, RunPrePaintLifecyclePhaseBeforeActivation) {}

}  // namespace
}  // namespace blink