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

/*
 * Copyright (C) 2010 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

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

#include "third_party/blink/public/web/web_frame.h"

#include <initializer_list>
#include <limits>
#include <memory>
#include <optional>
#include <tuple>

#include "base/functional/callback_helpers.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "cc/base/features.h"
#include "cc/input/overscroll_behavior.h"
#include "cc/layers/picture_layer.h"
#include "cc/paint/paint_op.h"
#include "cc/paint/paint_op_buffer_iterator.h"
#include "cc/paint/paint_recorder.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/scroll_node.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/system/data_pipe_drainer.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "skia/public/mojom/skcolor.mojom-blink.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/context_menu_data/context_menu_data.h"
#include "third_party/blink/public/common/context_menu_data/edit_flags.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
#include "third_party/blink/public/common/input/web_keyboard_event.h"
#include "third_party/blink/public/common/loader/referrer_utils.h"
#include "third_party/blink/public/common/messaging/transferable_message.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
#include "third_party/blink/public/common/page/launching_process_state.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/common/widget/device_emulation_params.h"
#include "third_party/blink/public/mojom/blob/blob.mojom-blink.h"
#include "third_party/blink/public/mojom/blob/data_element.mojom-blink.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/frame_owner_properties.mojom-blink.h"
#include "third_party/blink/public/mojom/frame/viewport_intersection_state.mojom-blink.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom-blink.h"
#include "third_party/blink/public/mojom/page_state/page_state.mojom-blink.h"
#include "third_party/blink/public/mojom/scroll/scrollbar_mode.mojom-blink.h"
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom-blink.h"
#include "third_party/blink/public/mojom/window_features/window_features.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/web_cache.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/test/test_web_frame_content_dumper.h"
#include "third_party/blink/public/web/web_console_message.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_document_loader.h"
#include "third_party/blink/public/web/web_form_element.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_history_item.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/public/web/web_navigation_timings.h"
#include "third_party/blink/public/web/web_navigation_type.h"
#include "third_party/blink/public/web/web_print_page_description.h"
#include "third_party/blink/public/web/web_print_params.h"
#include "third_party/blink/public/web/web_range.h"
#include "third_party/blink/public/web/web_remote_frame.h"
#include "third_party/blink/public/web/web_script_execution_callback.h"
#include "third_party/blink/public/web/web_script_source.h"
#include "third_party/blink/public/web/web_searchable_form_data.h"
#include "third_party/blink/public/web/web_security_policy.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/public/web/web_text_check_client.h"
#include "third_party/blink/public/web/web_text_checking_completion.h"
#include "third_party/blink/public/web/web_text_checking_result.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/serialized_script_value_factory.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/v8_script_value_serializer.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_node.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_pointer_event_init.h"
#include "third_party/blink/renderer/core/clipboard/data_transfer.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/css/css_page_rule.h"
#include "third_party/blink/renderer/core/css/media_values.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/css/resolver/viewport_style_resolver.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_sheet_contents.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/range.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/finder/text_finder.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/ime/input_method_controller.h"
#include "third_party/blink/renderer/core/editing/markers/document_marker_controller.h"
#include "third_party/blink/renderer/core/editing/position_with_affinity.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.h"
#include "third_party/blink/renderer/core/editing/spellcheck/spell_checker.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/events/message_event.h"
#include "third_party/blink/renderer/core/events/mouse_event.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/browser_controls.h"
#include "third_party/blink/renderer/core/frame/event_handler_registry.h"
#include "third_party/blink/renderer/core/frame/find_in_page.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/remote_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/viewport_data.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/frame/web_remote_frame_impl.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html/image_document.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/inspector/dev_tools_emulator.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.h"
#include "third_party/blink/renderer/core/messaging/blink_cloneable_message.h"
#include "third_party/blink/renderer/core/messaging/blink_transferable_message.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/drag_image.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/scoped_page_pauser.h"
#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.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/scroll/scrollbar.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_test_suite.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/core/testing/fake_local_frame_host.h"
#include "third_party/blink/renderer/core/testing/fake_remote_frame_host.h"
#include "third_party/blink/renderer/core/testing/fake_remote_main_frame_host.h"
#include "third_party/blink/renderer/core/testing/mock_clipboard_host.h"
#include "third_party/blink/renderer/core/testing/mock_policy_container_host.h"
#include "third_party/blink/renderer/core/testing/null_execution_context.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/scoped_fake_plugin_registry.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/core/testing/wait_for_event.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/blob/testing/fake_blob.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_request.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_context.h"
#include "third_party/blink/renderer/platform/loader/fetch/raw_resource.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_client.h"
#include "third_party/blink/renderer/platform/runtime_feature_state/runtime_feature_state_override_context.h"
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread_scheduler.h"
#include "third_party/blink/renderer/platform/testing/find_cc_layer.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/testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_loader_mock_factory.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/weborigin/kurl_hash.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/skia/include/core/SkTextBlob.h"
#include "ui/base/ime/mojom/text_input_state.mojom-blink.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/gfx/geometry/test/geometry_util.h"
#include "ui/gfx/geometry/transform.h"
#include "v8/include/v8.h"

SelectionMenuBehavior;
RunPendingTasks;
ToKURL;
_;
ElementsAre;
Mock;
Return;
UnorderedElementsAre;

namespace blink {

namespace {

const ScrollPaintPropertyNode* GetScrollNode(const LayoutObject& scroller) {}

std::string GetHTMLStringForReferrerPolicy(const std::string& meta_policy,
                                           const std::string& referrer_policy) {}

// A helper function to execute the given `scripts` in the main world of the
// specified `frame`.
void ExecuteScriptsInMainWorld(
    WebLocalFrame* frame,
    base::span<const String> scripts,
    WebScriptExecutionCallback callback,
    mojom::blink::PromiseResultOption wait_for_promise =
        mojom::blink::PromiseResultOption::kAwait,
    mojom::blink::UserActivationOption user_gesture =
        mojom::blink::UserActivationOption::kDoNotActivate) {}

// Same as above, but for a single script.
void ExecuteScriptInMainWorld(
    WebLocalFrame* frame,
    String script_string,
    WebScriptExecutionCallback callback,
    mojom::blink::PromiseResultOption wait_for_promise =
        mojom::blink::PromiseResultOption::kAwait,
    mojom::blink::UserActivationOption user_gesture =
        mojom::blink::UserActivationOption::kDoNotActivate) {}

}  // namespace

const int kTouchPointPadding =;

const cc::OverscrollBehavior kOverscrollBehaviorAuto =;

const cc::OverscrollBehavior kOverscrollBehaviorContain =;

const cc::OverscrollBehavior kOverscrollBehaviorNone =;

class WebFrameTest : public PageTestBase {};

TEST_F(WebFrameTest, ContentText) {}

TEST_F(WebFrameTest, FrameForEnteredContext) {}

class ScriptExecutionCallbackHelper final {};

TEST_F(WebFrameTest, RequestExecuteScript) {}

TEST_F(WebFrameTest, SuspendedRequestExecuteScript) {}

TEST_F(WebFrameTest, ExecuteScriptWithError) {}

TEST_F(WebFrameTest, ExecuteScriptWithPromiseWithoutWait) {}

TEST_F(WebFrameTest, ExecuteScriptWithPromiseFulfilled) {}

TEST_F(WebFrameTest, ExecuteScriptWithPromiseRejected) {}

TEST_F(WebFrameTest, ExecuteScriptWithFrameRemovalBeforePromiseResolves) {}

TEST_F(WebFrameTest, ExecuteScriptWithMultiplePromises) {}

TEST_F(WebFrameTest, ExecuteScriptWithMultiplePromisesWithDelayedSettlement) {}

TEST_F(WebFrameTest, ExecuteScriptWithMultipleSourcesWhereFirstIsPromise) {}

TEST_F(WebFrameTest, ExecuteScriptWithMultipleSourcesWhereLastIsPromise) {}

TEST_F(WebFrameTest, ExecuteScriptWithPromisesWhereOnlyFirstIsFulfilled) {}

TEST_F(WebFrameTest, ExecuteScriptWithPromisesWhereOnlyLastIsFulfilled) {}

TEST_F(WebFrameTest, RequestExecuteV8Function) {}

TEST_F(WebFrameTest, RequestExecuteV8FunctionWhileSuspended) {}

TEST_F(WebFrameTest, RequestExecuteV8FunctionWhileSuspendedWithUserGesture) {}

TEST_F(WebFrameTest, IframeScriptRemovesSelf) {}

namespace {

class CapabilityDelegationMessageListener final : public NativeEventListener {};

}  // namespace

TEST_F(WebFrameTest, CapabilityDelegationMessageEventTest) {}

TEST_F(WebFrameTest, FormWithNullFrame) {}

TEST_F(WebFrameTest, ChromePageJavascript) {}

TEST_F(WebFrameTest, ChromePageNoJavascript) {}

TEST_F(WebFrameTest, LocationSetHostWithMissingPort) {}

TEST_F(WebFrameTest, LocationSetEmptyPort) {}

class EvaluateOnLoadWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, DidClearWindowObjectIsNotRecursive) {}

class CSSCallbackWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

void CSSCallbackWebFrameClient::DidMatchCSS(
    const WebVector<WebString>& newly_matching_selectors,
    const WebVector<WebString>& stopped_matching_selectors) {}

class WebFrameCSSCallbackTest : public testing::Test {};

TEST_F(WebFrameCSSCallbackTest, AuthorStyleSheet) {}

TEST_F(WebFrameCSSCallbackTest, SharedComputedStyle) {}

TEST_F(WebFrameCSSCallbackTest, CatchesAttributeChange) {}

TEST_F(WebFrameCSSCallbackTest, DisplayNone) {}

TEST_F(WebFrameCSSCallbackTest, DisplayContents) {}

TEST_F(WebFrameCSSCallbackTest, Reparenting) {}

TEST_F(WebFrameCSSCallbackTest, MultiSelector) {}

TEST_F(WebFrameCSSCallbackTest, InvalidSelector) {}

TEST_F(WebFrameTest, PostMessageEvent) {}

namespace {

scoped_refptr<SerializedScriptValue> SerializeString(
    const StringView& message,
    ScriptState* script_state) {}

}  // namespace

TEST_F(WebFrameTest, PostMessageThenDetach) {}

TEST_F(WebFrameTest, PostMessageEvent_CannotDeserialize) {}

namespace {

// Helper function to set autosizing multipliers on a document.
bool SetTextAutosizingMultiplier(Document* document, float multiplier) {}

// Helper function to check autosizing multipliers on a document.
bool CheckTextAutosizingMultiplier(Document* document, float multiplier) {}

void UpdateScreenInfoAndResizeView(
    frame_test_helpers::WebViewHelper* web_view_helper,
    const display::ScreenInfo& screen_info) {}

void UpdateScreenInfoAndResizeView(
    frame_test_helpers::WebViewHelper* web_view_helper,
    int viewport_width,
    int viewport_height) {}

}  // namespace

TEST_F(WebFrameTest, ChangeInFixedLayoutResetsTextAutosizingMultipliers) {}

TEST_F(WebFrameTest, WorkingTextAutosizingMultipliers_VirtualViewport) {}

TEST_F(WebFrameTest,
       VisualViewportSetSizeInvalidatesTextAutosizingMultipliers) {}

TEST_F(WebFrameTest, ZeroHeightPositiveWidthNotIgnored) {}

TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) {}

TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumScale) {}

TEST_F(WebFrameTest, WideDocumentInitializeAtMinimumScale) {}

TEST_F(WebFrameTest, DelayedViewportInitialScale) {}

TEST_F(WebFrameTest, setLoadWithOverviewModeToFalse) {}

TEST_F(WebFrameTest, SetLoadWithOverviewModeToFalseAndNoWideViewport) {}

TEST_F(WebFrameTest, NoWideViewportIgnoresPageViewportWidth) {}

TEST_F(WebFrameTest, NoWideViewportIgnoresPageViewportWidthButAccountsScale) {}

TEST_F(WebFrameTest, WideViewportSetsTo980WithoutViewportTag) {}

TEST_F(WebFrameTest, WideViewportSetsTo980WithXhtmlMp) {}

TEST_F(WebFrameTest, NoWideViewportAndHeightInMeta) {}

TEST_F(WebFrameTest, WideViewportSetsTo980WithAutoWidth) {}

TEST_F(WebFrameTest, PageViewportInitialScaleOverridesLoadWithOverviewMode) {}

TEST_F(WebFrameTest, setInitialPageScaleFactorPermanently) {}

TEST_F(WebFrameTest,
       PermanentInitialPageScaleFactorOverridesLoadWithOverviewMode) {}

TEST_F(WebFrameTest,
       PermanentInitialPageScaleFactorOverridesPageViewportInitialScale) {}

TEST_F(WebFrameTest, SmallPermanentInitialPageScaleFactorIsClobbered) {}

TEST_F(WebFrameTest, PermanentInitialPageScaleFactorAffectsLayoutWidth) {}

TEST_F(WebFrameTest, DocumentElementClientHeightWorksWithWrapContentMode) {}

TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksWithWrapContentMode) {}

TEST_F(WebFrameTest, SetForceZeroLayoutHeight) {}

TEST_F(WebFrameTest, ToggleViewportMetaOnOff) {}

TEST_F(WebFrameTest,
       SetForceZeroLayoutHeightWorksWithRelayoutsWhenHeightChanged) {}

TEST_F(WebFrameTest, FrameOwnerPropertiesMargin) {}

TEST_F(WebFrameTest, FrameOwnerPropertiesScrolling) {}

TEST_F(WebFrameTest, SetForceZeroLayoutHeightWorksAcrossNavigations) {}

TEST_F(WebFrameTest, SetForceZeroLayoutHeightWithWideViewportQuirk) {}

TEST_F(WebFrameTest, WideViewportQuirkClobbersHeight) {}

TEST_F(WebFrameTest, OverflowHiddenDisablesScrolling) {}

TEST_F(WebFrameTest, OverflowHiddenDisablesScrollingWithSetCanHaveScrollbars) {}

TEST_F(WebFrameTest, IgnoreOverflowHiddenQuirk) {}

TEST_F(WebFrameTest, NonZeroValuesNoQuirk) {}

TEST_F(WebFrameTest, setPageScaleFactorDoesNotLayout) {}

TEST_F(WebFrameTest, setPageScaleFactorWithOverlayScrollbarsDoesNotLayout) {}

TEST_F(WebFrameTest, pageScaleFactorWrittenToHistoryItem) {}

TEST_F(WebFrameTest, initialScaleWrittenToHistoryItem) {}

TEST_F(WebFrameTest, pageScaleFactorDoesntShrinkFrameView) {}

TEST_F(WebFrameTest, pageScaleFactorDoesNotApplyCssTransform) {}

TEST_F(WebFrameTest, targetDensityDpiHigh) {}

TEST_F(WebFrameTest, targetDensityDpiDevice) {}

TEST_F(WebFrameTest, targetDensityDpiDeviceAndFixedWidth) {}

TEST_F(WebFrameTest, NoWideViewportAndScaleLessThanOne) {}

TEST_F(WebFrameTest, NoWideViewportAndScaleLessThanOneWithDeviceWidth) {}

TEST_F(WebFrameTest, NoWideViewportAndNoViewportWithInitialPageScaleOverride) {}

TEST_F(WebFrameTest, NoUserScalableQuirkIgnoresViewportScale) {}

TEST_F(WebFrameTest,
       NoUserScalableQuirkIgnoresViewportScaleForNonWideViewport) {}

TEST_F(WebFrameTest, NoUserScalableQuirkIgnoresViewportScaleForWideViewport) {}

TEST_F(WebFrameTest, DesktopPageCanBeZoomedInWhenWideViewportIsTurnedOff) {}

class WebFrameResizeTest : public WebFrameTest {};

TEST_F(WebFrameResizeTest,
       ResizeYieldsCorrectScrollAndScaleForWidthEqualsDeviceWidth) {}

TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForMinimumScale) {}

TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForFixedWidth) {}

TEST_F(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForFixedLayout) {}

TEST_F(WebFrameTest, pageScaleFactorUpdatesScrollbars) {}

TEST_F(WebFrameTest, CanOverrideScaleLimits) {}

// Android doesn't have scrollbars on the main LocalFrameView
#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameTest, DISABLED_updateOverlayScrollbarLayers)
#else
TEST_F(WebFrameTest, updateOverlayScrollbarLayers)
#endif
{}

void SetScaleAndScrollAndLayout(WebViewImpl* web_view,
                                const gfx::Point& scroll,
                                float scale) {}

void SimulatePageScale(WebViewImpl* web_view_impl, float& scale) {}

gfx::Rect ComputeBlockBoundHelper(WebViewImpl* web_view_impl,
                                  const gfx::Point& point,
                                  bool ignore_clipping) {}

void SimulateDoubleTap(WebViewImpl* web_view_impl,
                       gfx::Point& point,
                       float& scale) {}

TEST_F(WebFrameTest, DivAutoZoomParamsTest) {}

TEST_F(WebFrameTest, DivAutoZoomWideDivTest) {}

TEST_F(WebFrameTest, DivAutoZoomVeryTallTest) {}

TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTest) {}

TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest) {}

TEST_F(WebFrameTest, DivAutoZoomScaleLegibleScaleTest) {}

TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest) {}

TEST_F(WebFrameTest, BlockBoundTest) {}

TEST_F(WebFrameTest, DontZoomInOnFocusedInTouchAction) {}

TEST_F(WebFrameTest, DivScrollIntoEditableTest) {}

TEST_F(WebFrameTest, DivScrollIntoEditablePreservePageScaleTest) {}

// Tests the scroll into view functionality when
// autoZoomeFocusedNodeToLegibleScale set to false. i.e. The path non-Android
// platforms take.
TEST_F(WebFrameTest, DivScrollIntoEditableTestZoomToLegibleScaleDisabled) {}

// Tests zoom into editable zoom and scroll correctly when zoom-for-dsf enabled.
TEST_F(WebFrameTest, DivScrollIntoEditableTestWithDeviceScaleFactor) {}

TEST_F(WebFrameTest, FirstRectForCharacterRangeWithPinchZoom) {}
class TestReloadDoesntRedirectWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ReloadDoesntSetRedirect) {}

class ClearScrollStateOnCommitWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ReloadPreservesState) {}

TEST_F(WebFrameTest, ReloadWhileProvisional) {}

TEST_F(WebFrameTest, ClearFocusedNodeTest) {}

class ChangedSelectionCounter : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, TabKeyCursorMoveTriggersOneSelectionChange) {}

// Implementation of WebLocalFrameClient that tracks the v8 contexts that are
// created and destroyed for verification.
class ContextLifetimeTestWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ContextNotificationsLoadUnload) {}

TEST_F(WebFrameTest, ContextNotificationsReload) {}

TEST_F(WebFrameTest, ContextNotificationsIsolatedWorlds) {}

TEST_F(WebFrameTest, FindInPage) {}

TEST_F(WebFrameTest, GetContentAsPlainText) {}

TEST_F(WebFrameTest, GetFullHtmlOfPage) {}

class TestExecuteScriptDuringDidCreateScriptContext
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ExecuteScriptDuringDidCreateScriptContext) {}

class TestFindInPageClient : public mojom::blink::FindInPageClient {};

#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameTest, FindInPageMatchRects) {
  RegisterMockedHttpURLLoad("find_in_page_frame.html");

  frame_test_helpers::TestWebFrameClient frame_client;
  frame_test_helpers::WebViewHelper web_view_helper;
  web_view_helper.InitializeAndLoad(base_url_ + "find_in_page_frame.html",
                                    &frame_client);
  web_view_helper.Resize(gfx::Size(640, 480));
  web_view_helper.GetWebView()->SetMaximumLegibleScale(1.f);
  UpdateAllLifecyclePhases(web_view_helper.GetWebView());
  RunPendingTasks();

  // Note that the 'result 19' in the <select> element is not expected to
  // produce a match. Also, results 00 and 01 are in a different frame that is
  // not included in this test.
  const char kFindString[] = "result";
  const int kFindIdentifier = 12345;
  const int kNumResults = 17;

  auto options = mojom::blink::FindOptions::New();
  options->run_synchronously_for_testing = true;
  WebString search_text = WebString::FromUTF8(kFindString);
  WebLocalFrameImpl* main_frame = web_view_helper.LocalMainFrame();
  TestFindInPageClient find_in_page_client;
  find_in_page_client.SetFrame(main_frame);
  EXPECT_TRUE(main_frame->GetFindInPage()->FindInternal(
      kFindIdentifier, search_text, *options, false));

  main_frame->EnsureTextFinder().ResetMatchCount();

  for (WebLocalFrameImpl* frame = main_frame; frame;
       frame = To<WebLocalFrameImpl>(frame->TraverseNext())) {
    frame->EnsureTextFinder().StartScopingStringMatches(kFindIdentifier,
                                                        search_text, *options);
  }
  RunPendingTasks();
  EXPECT_TRUE(find_in_page_client.FindResultsAreReady());

  WebVector<gfx::RectF> web_match_rects =
      main_frame->EnsureTextFinder().FindMatchRects();
  ASSERT_EQ(static_cast<size_t>(kNumResults), web_match_rects.size());
  int rects_version = main_frame->GetFindInPage()->FindMatchMarkersVersion();

  for (int result_index = 0; result_index < kNumResults; ++result_index) {
    const gfx::RectF& result_rect = web_match_rects[result_index];

    // Select the match by the center of its rect.
    EXPECT_EQ(main_frame->EnsureTextFinder().SelectNearestFindMatch(
                  result_rect.CenterPoint(), nullptr),
              result_index + 1);

    // Check that the find result ordering matches with our expectations.
    Range* result = main_frame->GetTextFinder()->ActiveMatch();
    ASSERT_TRUE(result);
    result->setEnd(result->endContainer(), result->endOffset() + 3);
    EXPECT_EQ(result->GetText(),
              String::Format("%s %02d", kFindString, result_index + 2));

    // Verify that the expected match rect also matches the currently active
    // match.  Compare the enclosing rects to prevent precision issues caused by
    // CSS transforms.
    gfx::RectF active_match =
        main_frame->GetFindInPage()->ActiveFindMatchRect();
    EXPECT_EQ(gfx::ToEnclosingRect(active_match),
              gfx::ToEnclosingRect(result_rect));

    // The rects version should not have changed.
    EXPECT_EQ(main_frame->GetFindInPage()->FindMatchMarkersVersion(),
              rects_version);
  }

  // Resizing should update the rects version.
  web_view_helper.Resize(gfx::Size(800, 600));
  RunPendingTasks();
  EXPECT_TRUE(main_frame->GetFindInPage()->FindMatchMarkersVersion() !=
              rects_version);
}
#endif  // BUILDFLAG(IS_ANDROID)

TEST_F(WebFrameTest, FindInPageActiveIndex) {}

TEST_F(WebFrameTest, FindOnDetachedFrame) {}

TEST_F(WebFrameTest, FindDetachFrameBeforeScopeStrings) {}

TEST_F(WebFrameTest, FindDetachFrameWhileScopingStrings) {}

TEST_F(WebFrameTest, ResetMatchCount) {}

TEST_F(WebFrameTest, SetTickmarks) {}

TEST_F(WebFrameTest, FindInPageJavaScriptUpdatesDOM) {}

TEST_F(WebFrameTest, FindInPageJavaScriptUpdatesDOMProperOrdinal) {}

TEST_F(WebFrameTest, FindInPageStopFindActionKeepSelectionInAnotherDocument) {}

TEST_F(WebFrameTest, FindInPageForcedRedoOfFindInPage) {}

static gfx::Point BottomRightMinusOne(const gfx::Rect& rect) {}

static gfx::Rect ElementBounds(WebLocalFrame* frame, const WebString& id) {}

static std::string SelectionAsString(WebFrame* frame) {}

TEST_F(WebFrameTest, SelectRange) {}

TEST_F(WebFrameTest, SelectRangeDefaultHandleVisibility) {}

TEST_F(WebFrameTest, SelectRangeHideHandle) {}

TEST_F(WebFrameTest, SelectRangeShowHandle) {}

TEST_F(WebFrameTest, SelectRangePreserveHandleVisibility) {}

TEST_F(WebFrameTest, SelectRangeInIframe) {}

TEST_F(WebFrameTest, SelectRangeDivContentEditable) {}

// positionForPoint returns the wrong values for contenteditable spans. See
// http://crbug.com/238334.
TEST_F(WebFrameTest, DISABLED_SelectRangeSpanContentEditable) {}

TEST_F(WebFrameTest, SelectRangeCanMoveSelectionStart) {}

TEST_F(WebFrameTest, SelectRangeCanMoveSelectionEnd) {}

TEST_F(WebFrameTest, MoveRangeSelectionExtent) {}

TEST_F(WebFrameTest, MoveRangeSelectionExtentCannotCollapse) {}

TEST_F(WebFrameTest, MoveRangeSelectionExtentScollsInputField) {}

TEST_F(WebFrameTest, SmartClipData) {}

TEST_F(WebFrameTest, SmartClipDataWithPinchZoom) {}

TEST_F(WebFrameTest, SmartClipReturnsEmptyStringsWhenUserSelectIsNone) {}

TEST_F(WebFrameTest, SmartClipDoesNotCrashPositionReversed) {}

static int ComputeOffset(LayoutObject* layout_object, int x, int y) {}

// positionForPoint returns the wrong values for contenteditable spans. See
// http://crbug.com/238334.
TEST_F(WebFrameTest, DISABLED_PositionForPointTest) {}

#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
    BUILDFLAG(IS_CHROMEOS)
// TODO(crbug.com/1090246): Fix these tests on Fuchsia and re-enable.
// TODO(crbug.com/1317375): Build these tests on all platforms.
#define MAYBE_SelectRangeStaysHorizontallyAlignedWhenMoved
#define MAYBE_MoveCaretStaysHorizontallyAlignedWhenMoved
#else
#define MAYBE_SelectRangeStaysHorizontallyAlignedWhenMoved
#define MAYBE_MoveCaretStaysHorizontallyAlignedWhenMoved
#endif
TEST_F(WebFrameTest, MAYBE_SelectRangeStaysHorizontallyAlignedWhenMoved) {}

TEST_F(WebFrameTest, MAYBE_MoveCaretStaysHorizontallyAlignedWhenMoved) {}

class CompositedSelectionBoundsTest
    : public WebFrameTest,
      private ScopedCompositedSelectionUpdateForTest {};

TEST_F(CompositedSelectionBoundsTest, None) {}
TEST_F(CompositedSelectionBoundsTest, NoneReadonlyCaret) {}
TEST_F(CompositedSelectionBoundsTest, DetachedFrame) {}

TEST_F(CompositedSelectionBoundsTest, Basic) {}
TEST_F(CompositedSelectionBoundsTest, Transformed) {}
TEST_F(CompositedSelectionBoundsTest, VerticalRightToLeft) {}
TEST_F(CompositedSelectionBoundsTest, VerticalLeftToRight) {}
TEST_F(CompositedSelectionBoundsTest, BasicRTL) {}
TEST_F(CompositedSelectionBoundsTest, VerticalRightToLeftRTL) {}
TEST_F(CompositedSelectionBoundsTest, VerticalLeftToRightRTL) {}
TEST_F(CompositedSelectionBoundsTest, SplitLayer) {}
TEST_F(CompositedSelectionBoundsTest, Iframe) {}
TEST_F(CompositedSelectionBoundsTest, Editable) {}
TEST_F(CompositedSelectionBoundsTest, EditableDiv) {}
TEST_F(CompositedSelectionBoundsTest, SVGBasic) {}
TEST_F(CompositedSelectionBoundsTest, SVGTextWithFragments) {}
TEST_F(CompositedSelectionBoundsTest, LargeSelectionScroll) {}
TEST_F(CompositedSelectionBoundsTest, LargeSelectionNoScroll) {}
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#if !BUILDFLAG(IS_ANDROID)
TEST_F(CompositedSelectionBoundsTest, Input) {}
TEST_F(CompositedSelectionBoundsTest, InputScrolled) {}
#endif
#endif

class CompositedSelectionBoundsTestWithImage
    : public CompositedSelectionBoundsTest {};

TEST_F(CompositedSelectionBoundsTestWithImage, Replaced) {}

TEST_F(CompositedSelectionBoundsTestWithImage, ReplacedRTL) {}

TEST_F(CompositedSelectionBoundsTestWithImage, ReplacedVerticalLR) {}

class TestWillInsertBodyWebFrameClient final
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, HTMLDocument) {}

TEST_F(WebFrameTest, EmptyDocument) {}

TEST_F(WebFrameTest, MoveCaretSelectionTowardsWindowPointWithNoSelection) {}

class TextCheckClient : public WebTextCheckClient {};

TEST_F(WebFrameTest, ReplaceMisspelledRange) {}

TEST_F(WebFrameTest, RemoveSpellingMarkers) {}

static void GetSpellingMarkerOffsets(WebVector<unsigned>* offsets,
                                     const Document& document) {}

TEST_F(WebFrameTest, RemoveSpellingMarkersUnderWords) {}

class StubbornTextCheckClient : public WebTextCheckClient {};

TEST_F(WebFrameTest, SlowSpellcheckMarkerPosition) {}

TEST_F(WebFrameTest, SpellcheckResultErasesMarkers) {}

TEST_F(WebFrameTest, SpellcheckResultsSavedInDocument) {}

class TestAccessInitialDocumentLocalFrameHost
    : public mojom::blink::LocalMainFrameHost {};

TEST_F(WebFrameTest, DidAccessInitialMainDocumentBody) {}

TEST_F(WebFrameTest, DidAccessInitialMainDocumentOpen) {}

TEST_F(WebFrameTest, DidAccessInitialMainDocumentNavigator) {}

TEST_F(WebFrameTest, DidAccessInitialMainDocumentViaJavascriptUrl) {}

TEST_F(WebFrameTest, DidAccessInitialMainDocumentBodyBeforeModalDialog) {}

TEST_F(WebFrameTest, DidWriteToInitialMainDocumentBeforeModalDialog) {}

class TestScrolledFrameClient : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, CompositorScrollIsUserScrollLongPage) {}

TEST_F(WebFrameTest, SiteForCookiesForRedirect) {}

class TestNewWindowWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ModifiedClickNewWindow) {}

class TestBeginNavigationCacheModeClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, BackToReload) {}

TEST_F(WebFrameTest, ReloadPost) {}

class TestCachePolicyWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ReloadIframe) {}

class TestMainFrameIntersectionChanged
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, MainFrameIntersectionChanged) {}

class TestSameDocumentWithImageWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, NavigateToSameNoConditionalRequestForSubresource) {}

TEST_F(WebFrameTest, WebNodeImageContents) {}

TEST_F(WebFrameTest, WebNodeImageContentsWithOrientation) {}

class TestStartStopCallbackWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, PushStateStartsAndStops) {}

TEST_F(WebFrameTest,
       CommitSynchronousNavigationForAboutBlankAndCheckStorageKeyNonce) {}

class TestDidNavigateCommitTypeWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, SameDocumentHistoryNavigationCommitType) {}

// Tests that a navigation in a frame with a non-blank initial URL will create
// a new history item, unlike the case above.
TEST_F(WebFrameTest, FirstNonBlankSubframeNavigation) {}

// Test verifies that layout will change a layer's scrollable attibutes
TEST_F(WebFrameTest, overflowHiddenRewrite) {}

// Test that currentHistoryItem reflects the current page, not the provisional
// load.
TEST_F(WebFrameTest, CurrentHistoryItem) {}

class FailCreateChildFrame : public frame_test_helpers::TestWebFrameClient {};

// Test that we don't crash if WebLocalFrameClient::createChildFrame() fails.
TEST_F(WebFrameTest, CreateChildFrameFailure) {}

TEST_F(WebFrameTest, fixedPositionInFixedViewport) {}

TEST_F(WebFrameTest, FrameViewMoveWithSetFrameRect) {}

TEST_F(WebFrameTest, FrameViewScrollAccountsForBrowserControls) {}

TEST_F(WebFrameTest, MaximumScrollPositionCanBeNegative) {}

TEST_F(WebFrameTest, FullscreenLayerSize) {}

TEST_F(WebFrameTest, FullscreenLayerNonScrollable) {}

TEST_F(WebFrameTest, FullscreenMainFrame) {}

TEST_F(WebFrameTest, FullscreenSubframe) {}

// Tests entering nested fullscreen and then exiting via the same code path
// that's used when the browser process exits fullscreen.
TEST_F(WebFrameTest, FullscreenNestedExit) {}

TEST_F(WebFrameTest, FullscreenWithTinyViewport) {}

TEST_F(WebFrameTest, FullscreenResizeWithTinyViewport) {}

TEST_F(WebFrameTest, FullscreenRestoreScaleFactorUponExiting) {}

// Tests that leaving fullscreen by navigating to a new page resets the
// fullscreen page scale constraints.
TEST_F(WebFrameTest, ClearFullscreenConstraintsOnNavigation) {}

TEST_F(WebFrameTest, WebXrImmersiveOverlay) {}

TEST_F(WebFrameTest, FullscreenFrameSet) {}

TEST_F(WebFrameTest, HasVisibleContentOnVisibleFrames) {}

TEST_F(WebFrameTest, HasVisibleContentOnHiddenFrames) {}

static Resource* FetchManifest(Document* document, const KURL& url) {}

TEST_F(WebFrameTest, ManifestFetch) {}

TEST_F(WebFrameTest, ManifestCSPFetchAllow) {}

TEST_F(WebFrameTest, ManifestCSPFetchSelf) {}

TEST_F(WebFrameTest, ManifestCSPFetchSelfReportOnly) {}

TEST_F(WebFrameTest, ReloadBypassingCache) {}

static void NodeImageTestValidation(const gfx::Size& reference_bitmap_size,
                                    DragImage* drag_image) {}

TEST_F(WebFrameTest, NodeImageTestCSSTransformDescendant) {}

TEST_F(WebFrameTest, NodeImageTestCSSTransform) {}

TEST_F(WebFrameTest, NodeImageTestCSS3DTransform) {}

TEST_F(WebFrameTest, NodeImageTestInlineBlock) {}

TEST_F(WebFrameTest, NodeImageTestFloatLeft) {}

// Crashes on Android: http://crbug.com/403804
#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameTest, DISABLED_PrintingBasic)
#else
TEST_F(WebFrameTest, PrintingBasic)
#endif
{}

class ThemeColorTestLocalFrameHost : public FakeLocalFrameHost {};

TEST_F(WebFrameTest, ThemeColor) {}

// Make sure that an embedder-triggered detach with a remote frame parent
// doesn't leave behind dangling pointers.
TEST_F(WebFrameTest, EmbedderTriggeredDetachWithRemoteMainFrame) {}

class WebFrameSwapTestClient : public frame_test_helpers::TestWebFrameClient {};

class WebFrameSwapTest : public WebFrameTest {};

TEST_F(WebFrameSwapTest, SwapMainFrame) {}

class DidClearWindowObjectCounter
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameSwapTest, SwapMainFrameLocalToLocal) {}

TEST_F(WebFrameSwapTest, DetachProvisionalLocalFrameAndPlaceholderRemoteFrame) {}

TEST_F(WebFrameSwapTest, SwapMainFrameWithPageScaleReset) {}

TEST_F(WebFrameSwapTest, ValidateSizeOnRemoteToLocalMainFrameSwap) {}

// Verify that size changes to browser controls while the main frame is remote
// are preserved when the main frame swaps to a local frame.  See
// https://crbug.com/769321.
TEST_F(WebFrameSwapTest,
       ValidateBrowserControlsSizeOnRemoteToLocalMainFrameSwap) {}

namespace {

class SwapMainFrameWhenTitleChangesWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

}  // namespace

TEST_F(WebFrameTest, SwapMainFrameWhileLoading) {}

TEST_F(WebFrameTest, SwapChildAddFrameInUnload) {}

void WebFrameTest::SwapAndVerifyFirstChildConsistency(const char* const message,
                                                      WebFrame* parent,
                                                      WebFrame* new_child) {}

TEST_F(WebFrameSwapTest, SwapFirstChild) {}

// Asserts that the `Settings::SetHighlightAds` is properly applied to a
// `LocalFrame` even if `Settings::SetHighlightAds` is fired when the
// `LocalFrame` is still provisional. See crbug/1312107. While the bug is first
// observed on fenced frames, the underlying issue lies in the timing of the
// `Settings::SetHighlightAds` call with respect to the navigation progress of
// the frame.
TEST_F(WebFrameSwapTest, AdHighlightEarlyApply) {}

// TODO(crbug.com/1314493): This test is flaky with the TimedHTMLParserBudget
// feature enabled.
TEST_F(WebFrameSwapTest, DISABLED_DoNotPropagateDisplayNonePropertyOnSwap) {}

void WebFrameTest::SwapAndVerifyMiddleChildConsistency(
    const char* const message,
    WebFrame* parent,
    WebFrame* new_child) {}

TEST_F(WebFrameSwapTest, SwapMiddleChild) {}

void WebFrameTest::SwapAndVerifyLastChildConsistency(const char* const message,
                                                     WebFrame* parent,
                                                     WebFrame* new_child) {}

TEST_F(WebFrameSwapTest, SwapLastChild) {}

TEST_F(WebFrameSwapTest, DetachProvisionalFrame) {}

void WebFrameTest::SwapAndVerifySubframeConsistency(const char* const message,
                                                    WebFrame* old_frame,
                                                    WebFrame* new_frame) {}

TEST_F(WebFrameSwapTest, EventsOnDisconnectedSubDocumentSkipped) {}

TEST_F(WebFrameSwapTest, EventsOnDisconnectedElementSkipped) {}

TEST_F(WebFrameSwapTest, SwapParentShouldDetachChildren) {}

TEST_F(WebFrameSwapTest, SwapPreservesGlobalContext) {}

TEST_F(WebFrameSwapTest, SetTimeoutAfterSwap) {}

TEST_F(WebFrameSwapTest, SwapInitializesGlobal) {}

TEST_F(WebFrameSwapTest, RemoteFramesAreIndexable) {}

TEST_F(WebFrameSwapTest, RemoteFrameLengthAccess) {}

TEST_F(WebFrameSwapTest, RemoteWindowNamedAccess) {}

TEST_F(WebFrameSwapTest, RemoteWindowToString) {}

// TODO(alexmos, dcheng): This test and some other OOPIF tests use
// very little of the test fixture support in WebFrameSwapTest.  We should
// clean these tests up.
TEST_F(WebFrameSwapTest, FramesOfRemoteParentAreIndexable) {}

// Check that frames with a remote parent don't crash while accessing
// window.frameElement.
TEST_F(WebFrameSwapTest, FrameElementInFramesWithRemoteParent) {}

class RemoteToLocalSwapWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

// The commit type should be Standard if we are swapping a RemoteFrame to a
// LocalFrame after commits have already happened in the frame.  The browser
// process will inform us via setCommittedFirstRealLoad.
TEST_F(WebFrameSwapTest, HistoryCommitTypeAfterExistingRemoteToLocalSwap) {}

class RemoteFrameHostInterceptor : public FakeRemoteFrameHost {};

TEST_F(WebFrameSwapTest, NavigateRemoteFrameViaLocation) {}

TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame) {}

// blink::mojom::RemoteMainFrameHost instance that intecepts CloseWindowSoon()
// mojo calls and provides a getter to know if it was ever called.
class TestRemoteMainFrameHostForWindowClose : public FakeRemoteMainFrameHost {};

class RemoteWindowCloseTest : public WebFrameTest {};

TEST_F(RemoteWindowCloseTest, WindowOpenRemoteClose) {}

// Tests that calling window.close() when detaching document as a result of
// closing the WebView shouldn't crash. This is a regression test for
// https://crbug.com/5058796.
TEST_F(WebFrameTest, WindowCloseOnDetach) {}

TEST_F(WebFrameTest, NavigateRemoteToLocalWithOpener) {}

TEST_F(WebFrameTest, SwapWithOpenerCycle) {}

class CommitTypeWebFrameClient final
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, DetachRemoteFrame) {}

class TestConsoleMessageWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, CrossDomainAccessErrorsUseCallingWindow) {}

TEST_F(WebFrameTest, ResizeInvalidatesDeviceMediaQueries) {}

class DeviceEmulationTest : public WebFrameTest {};

TEST_F(DeviceEmulationTest, DeviceSizeInvalidatedOnResize) {}

TEST_F(DeviceEmulationTest, PointerAndHoverTypes) {}

TEST_F(WebFrameTest, CreateLocalChildWithPreviousSibling) {}

TEST_F(WebFrameTest, SendBeaconFromChildWithRemoteMainFrame) {}

TEST_F(WebFrameTest, SiteForCookiesFromChildWithRemoteMainFrame) {}

// See https://crbug.com/525285.
TEST_F(WebFrameTest, RemoteToLocalSwapOnMainFrameInitializesCoreFrame) {}

// See https://crbug.com/628942.
TEST_F(WebFrameTest, PausedPageLoadWithRemoteMainFrame) {}

class WebFrameOverscrollTest
    : public WebFrameTest,
      public testing::WithParamInterface<WebGestureDevice> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(WebFrameOverscrollTest,
       AccumulatedRootOverscrollAndUnsedDeltaValuesOnOverscroll) {}

TEST_P(WebFrameOverscrollTest,
       AccumulatedOverscrollAndUnusedDeltaValuesOnDifferentAxesOverscroll) {}

TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerDivOverScroll) {}

TEST_P(WebFrameOverscrollTest, RootLayerOverscrolledOnInnerIFrameOverScroll) {}

TEST_P(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) {}

TEST_P(WebFrameOverscrollTest, NoOverscrollForSmallvalues) {}

TEST_P(WebFrameOverscrollTest, OverscrollBehaviorGoesToCompositor) {}

TEST_P(WebFrameOverscrollTest, SubframeOverscrollBehaviorPreventsChaining) {}

TEST_F(WebFrameTest, OrientationFrameDetach) {}

TEST_F(WebFrameTest, MaxFrames) {}

class TestViewportIntersection : public FakeRemoteFrameHost {};

TEST_F(WebFrameTest, RotatedIframeViewportIntersection) {}

TEST_F(WebFrameTest, ImageDocumentLoadResponseEnd) {}

TEST_F(WebFrameTest, CopyImageDocument) {}

TEST_F(WebFrameTest, CopyTextInImageDocument) {}

class SelectionMockWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebFrameTest, ImeSelectionCommitDoesNotChangeClipboard) {}

class TestRemoteFrameHostForVisibility : public FakeRemoteFrameHost {};

class WebRemoteFrameVisibilityChangeTest : public WebFrameTest {};

TEST_F(WebRemoteFrameVisibilityChangeTest, FrameVisibilityChange) {}

TEST_F(WebRemoteFrameVisibilityChangeTest, ParentVisibilityChange) {}

class TestLocalFrameHostForVisibility : public FakeLocalFrameHost {};

class WebLocalFrameVisibilityChangeTest
    : public WebFrameTest,
      public frame_test_helpers::TestWebFrameClient {};

TEST_F(WebLocalFrameVisibilityChangeTest, FrameVisibilityChange) {}

TEST_F(WebLocalFrameVisibilityChangeTest, ParentVisibilityChange) {}

static void EnableGlobalReuseForUnownedMainFrames(WebSettings* settings) {}

// A main frame with no opener should have a unique security origin. Thus, the
// global should never be reused on the initial navigation.
TEST(WebFrameGlobalReuseTest, MainFrameWithNoOpener) {}

// Child frames should never reuse the global on a cross-origin navigation, even
// if the setting is enabled. It's not safe to since the parent could have
// injected script before the initial navigation.
TEST(WebFrameGlobalReuseTest, ChildFrame) {}

// A main frame with an opener should never reuse the global on a cross-origin
// navigation, even if the setting is enabled. It's not safe to since the opener
// could have injected script.
TEST(WebFrameGlobalReuseTest, MainFrameWithOpener) {}

// A main frame that is unrelated to any other frame /can/ reuse the global if
// the setting is enabled. In this case, it's impossible for any other frames to
// have touched the global. Only the embedder could have injected script, and
// the embedder enabling this setting is a signal that the injected script needs
// to persist on the first navigation away from the initial empty document.
TEST(WebFrameGlobalReuseTest, ReuseForMainFrameIfEnabled) {}

// This class intercepts the registration of Blob instances.
//
// Given that the content of the Blob is known (data URL)
// it gets the data from the DataElement's BytesProvider, and creates
// FakeBlob's accordingly.
class BlobRegistryForSaveImageFromDataURL : public mojom::blink::BlobRegistry {};

// blink::mojom::LocalFrameHost instance that intecepts DownloadURL() mojo
// calls and reads the blob data URL sent by the renderer accordingly.
class TestLocalFrameHostForSaveImageFromDataURL : public FakeLocalFrameHost {};

TEST_F(WebFrameTest, SaveImageAt) {}

TEST_F(WebFrameTest, SaveImageWithImageMap) {}

TEST_F(WebFrameTest, CopyImageWithImageMap) {}

TEST_F(WebFrameTest, LoadJavascriptURLInNewFrame) {}

TEST_F(WebFrameTest, DiscardFrame) {}

TEST_F(WebFrameTest, EmptyJavascriptFrameUrl) {}

class TestResourcePriorityWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

// TODO(crbug.com/1314493): This test is flaky with the TimedHTMLParserBudget
// feature enabled.
TEST_F(WebFrameTest, DISABLED_ChangeResourcePriority) {}

TEST_F(WebFrameTest, ScriptPriority) {}

class MultipleDataChunkDelegate : public URLLoaderTestDelegate {};

TEST_F(WebFrameTest, ImageDocumentDecodeError) {}

// Ensure that the root LayoutView maintains a minimum height matching the
// viewport in cases where the content is smaller.
TEST_F(WebFrameTest, RootLayerMinimumHeight) {}

// Load a page with display:none set and try to scroll it. It shouldn't crash
// due to lack of layoutObject. crbug.com/653327.
TEST_F(WebFrameTest, ScrollBeforeLayoutDoesntCrash) {}

TEST_F(WebFrameTest, MouseOverDifferntNodeClearsTooltip) {}

class WebFrameSimTest : public SimTest {};

TEST_F(WebFrameSimTest, HitTestWithIgnoreClippingAtNegativeOffset) {}

TEST_F(WebFrameSimTest, TickmarksDocumentRelative) {}

#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameSimTest, FindInPageSelectNextMatch) {
  WebView().MainFrameViewWidget()->Resize(gfx::Size(500, 300));
  WebView().GetPage()->GetSettings().SetTextAutosizingEnabled(false);

  SimRequest request("https://example.com/test.html", "text/html");
  LoadURL("https://example.com/test.html");
  request.Complete(R"HTML(
      <!DOCTYPE html>
      <style>
        body, html {
          width: 4000px;
          height: 4000px;
          margin: 0;
        }
        #box1 {
          position: absolute;
          left: 800px;
          top: 2000px;
        }

        #box2 {
          position: absolute;
          left: 1000px;
          top: 3000px;
        }
      </style>
      <div id="box1">test</div>
      <div id="box2">test</div>
  )HTML");

  Compositor().BeginFrame();

  auto* frame = To<WebLocalFrameImpl>(WebView().MainFrame());
  auto* local_frame = To<LocalFrame>(WebView().GetPage()->MainFrame());
  auto* frame_view = local_frame->View();

  Element* box1 = GetDocument().getElementById(AtomicString("box1"));
  Element* box2 = GetDocument().getElementById(AtomicString("box2"));

  gfx::Rect box1_rect = box1->GetLayoutObject()->AbsoluteBoundingBoxRect();
  gfx::Rect box2_rect = box2->GetLayoutObject()->AbsoluteBoundingBoxRect();

  frame_view->GetScrollableArea()->SetScrollOffset(
      ScrollOffset(3000, 1000), mojom::blink::ScrollType::kProgrammatic);
  auto options = mojom::blink::FindOptions::New();
  options->run_synchronously_for_testing = true;
  WebString search_text = WebString::FromUTF8("test");
  const int kFindIdentifier = 12345;
  EXPECT_TRUE(frame->GetFindInPage()->FindInternal(kFindIdentifier, search_text,
                                                   *options, false));

  frame->EnsureTextFinder().ResetMatchCount();
  frame->EnsureTextFinder().StartScopingStringMatches(kFindIdentifier,
                                                      search_text, *options);

  WebVector<gfx::RectF> web_match_rects =
      frame->EnsureTextFinder().FindMatchRects();
  ASSERT_EQ(2ul, web_match_rects.size());

  gfx::RectF result_rect = web_match_rects[0];
  frame->EnsureTextFinder().SelectNearestFindMatch(result_rect.CenterPoint(),
                                                   nullptr);

  EXPECT_TRUE(frame_view->GetScrollableArea()->VisibleContentRect().Contains(
      box1_rect));
  result_rect = web_match_rects[1];
  frame->EnsureTextFinder().SelectNearestFindMatch(result_rect.CenterPoint(),
                                                   nullptr);

  EXPECT_TRUE(
      frame_view->GetScrollableArea()->VisibleContentRect().Contains(box2_rect))
      << "Box [" << box2_rect.ToString() << "] is not visible in viewport ["
      << frame_view->GetScrollableArea()->VisibleContentRect().ToString()
      << "]";
}
#endif  // BUILDFLAG(IS_ANDROID)

// Check that removing an element whilst focusing it does not cause a null
// pointer deference. This test passes if it does not crash.
// https://crbug.com/1184546
TEST_F(WebFrameSimTest, FocusOnBlurRemoveBubblingCrash) {}

// Test bubbling a document (End key) scroll from an inner iframe. This test
// passes if it does not crash. https://crbug.com/904247.
TEST_F(WebFrameSimTest, ScrollToEndBubblingCrash) {}

TEST_F(WebFrameSimTest, TestScrollFocusedEditableElementIntoView) {}

// Ensures scrolling a focused editable text into view that's located in the
// root scroller works by scrolling the root scroller.
TEST_F(WebFrameSimTest, TestScrollFocusedEditableInRootScroller) {}

TEST_F(WebFrameSimTest, ScrollFocusedIntoViewClipped) {}

// This test ensures that we scroll to the correct scale when the focused
// element has a selection rather than a caret.
TEST_F(WebFrameSimTest, ScrollFocusedSelectionIntoView) {}

TEST_F(WebFrameSimTest, DoubleTapZoomWhileScrolled) {}

TEST_F(WebFrameSimTest, ChangeBackgroundColor) {}

// Ensure we don't crash if we try to scroll into view the focused editable
// element which doesn't have a LayoutObject.
TEST_F(WebFrameSimTest, ScrollFocusedEditableIntoViewNoLayoutObject) {}

TEST_F(WebFrameSimTest, ScrollEditContextIntoView) {}

TEST_F(WebFrameSimTest, DisplayNoneIFrameHasNoLayoutObjects) {}

// Although it is not spec compliant, many websites intentionally call
// Window.print() on display:none iframes. https://crbug.com/819327.
TEST_F(WebFrameSimTest, DisplayNoneIFramePrints) {}

TEST_F(WebFrameSimTest, NormalIFrameHasLayoutObjects) {}

TEST_F(WebFrameSimTest, RtlInitialScrollOffsetWithViewport) {}

TEST_F(WebFrameSimTest, LayoutViewportExceedsLayoutOverflow) {}

TEST_F(WebFrameSimTest, LayoutViewLocalVisualRect) {}

TEST_F(WebFrameSimTest, NamedLookupIgnoresEmptyNames) {}

TEST_F(WebFrameTest, NoLoadingCompletionCallbacksInDetach) {}

TEST_F(WebFrameTest, ClearClosedOpener) {}

TEST_F(WebFrameTest, ShowVirtualKeyboardOnElementFocus) {}

class ContextMenuWebFrameClient
    : public frame_test_helpers::TestWebFrameClient {};

bool TestSelectAll(const std::string& html) {}

TEST_F(WebFrameTest, ContextMenuDataSelectAll) {}

TEST_F(WebFrameTest, ContextMenuDataSelectedText) {}

TEST_F(WebFrameTest, ContextMenuDataPasswordSelectedText) {}

TEST_F(WebFrameTest, ContextMenuDataNonLocatedMenu) {}

TEST_F(WebFrameTest, LocalFrameWithRemoteParentIsTransparent) {}

TEST_F(WebFrameTest, AltTextOnAboutBlankPage) {}

static void TestFramePrinting(WebLocalFrameImpl* frame) {}

TEST_F(WebFrameTest, PrintDetachedIframe) {}

TEST_F(WebFrameTest, PrintIframeUnderDetached) {}

namespace {

struct TextRunDOMNodeIdInfo {};

// Given a PaintRecord and a starting DOMNodeId, recursively iterate over all of
// the (nested) paint ops, and populate |text_runs| with the number of glyphs
// and the DOMNodeId of each text run.
void RecursiveCollectTextRunDOMNodeIds(
    const PaintRecord& paint_record,
    DOMNodeId dom_node_id,
    std::vector<TextRunDOMNodeIdInfo>* text_runs) {}

std::vector<TextRunDOMNodeIdInfo> GetPrintedTextRunDOMNodeIds(
    WebLocalFrame* frame,
    const WebVector<uint32_t>* pages = nullptr) {}

}  // namespace

TEST_F(WebFrameTest, PrintSomePages) {}

TEST_F(WebFrameTest, PrintAllPages) {}

TEST_F(WebFrameTest, FirstLetterHasDOMNodeIdWhenPrinting) {}

TEST_F(WebFrameTest, RightClickActivatesForExecuteCommand) {}

TEST_F(WebFrameSimTest, EnterFullscreenResetScrollAndScaleState) {}

TEST_F(WebFrameSimTest, PageSizeType) {}

TEST_F(WebFrameSimTest, PageOrientation) {}

TEST_F(WebFrameSimTest, MainFrameTransformOffsetPixelSnapped) {}

TEST_F(WebFrameTest, MediaQueriesInLocalFrameInsideRemote) {}

TEST_F(WebFrameTest, RemoteViewportAndMainframeIntersections) {}

class TestUpdateFaviconURLLocalFrameHost : public FakeLocalFrameHost {};

// Ensure the render view sends favicon url update events correctly.
TEST_F(WebFrameTest, FaviconURLUpdateEvent) {}

class TestFocusedElementChangedLocalFrameHost : public FakeLocalFrameHost {};

TEST_F(WebFrameTest, FocusElementCallsFocusedElementChanged) {}

// Tests that form.submit() cancels any navigations already sent to the browser
// process.
TEST_F(WebFrameTest, FormSubmitCancelsNavigation) {}

class TestLocalFrameHostForAnchorWithDownloadAttr : public FakeLocalFrameHost {};

TEST_F(WebFrameTest, DownloadReferrerPolicy) {}

TEST_F(WebFrameTest, RemoteFrameCompositingScaleFactor) {}

TEST_F(WebFrameTest, RotatedRemoteFrameCompositingScaleFactor) {}

TEST_F(WebFrameTest, ZeroScaleRemoteFrameCompositingScaleFactor) {}

TEST_F(WebFrameTest, LargeScaleRemoteFrameCompositingScaleFactor) {}

TEST_F(WebFrameTest, VerticalRLScrollOffset) {}

TEST_F(WebFrameTest, FrameOwnerColorScheme) {}

TEST_F(WebFrameSimTest, RenderBlockingPromotesResource) {}

// Verify that modified_runtime_features is correctly set in the
// RuntimeFeatureStateOverrideContext when a navigation is committed.
TEST_F(WebFrameSimTest, SetModifiedFeaturesInOverrideContext) {}

TEST_F(WebFrameTest, IframeMoveBeforeConnectedSubframeCount) {}

}  // namespace blink