#ifdef UNSAFE_BUFFERS_BUILD
#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) { … }
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) { … }
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) { … }
}
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 { … };
}
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) { … }
}
TEST_F(WebFrameTest, PostMessageThenDetach) { … }
TEST_F(WebFrameTest, PostMessageEvent_CannotDeserialize) { … }
namespace {
bool SetTextAutosizingMultiplier(Document* document, float multiplier) { … }
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) { … }
}
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) { … }
#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) { … }
TEST_F(WebFrameTest, DivScrollIntoEditableTestZoomToLegibleScaleDisabled) { … }
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) { … }
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();
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];
EXPECT_EQ(main_frame->EnsureTextFinder().SelectNearestFindMatch(
result_rect.CenterPoint(), nullptr),
result_index + 1);
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));
gfx::RectF active_match =
main_frame->GetFindInPage()->ActiveFindMatchRect();
EXPECT_EQ(gfx::ToEnclosingRect(active_match),
gfx::ToEnclosingRect(result_rect));
EXPECT_EQ(main_frame->GetFindInPage()->FindMatchMarkersVersion(),
rects_version);
}
web_view_helper.Resize(gfx::Size(800, 600));
RunPendingTasks();
EXPECT_TRUE(main_frame->GetFindInPage()->FindMatchMarkersVersion() !=
rects_version);
}
#endif
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) { … }
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) { … }
TEST_F(WebFrameTest, DISABLED_PositionForPointTest) { … }
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
#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) { … }
TEST_F(WebFrameTest, FirstNonBlankSubframeNavigation) { … }
TEST_F(WebFrameTest, overflowHiddenRewrite) { … }
TEST_F(WebFrameTest, CurrentHistoryItem) { … }
class FailCreateChildFrame : public frame_test_helpers::TestWebFrameClient { … };
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) { … }
TEST_F(WebFrameTest, FullscreenNestedExit) { … }
TEST_F(WebFrameTest, FullscreenWithTinyViewport) { … }
TEST_F(WebFrameTest, FullscreenResizeWithTinyViewport) { … }
TEST_F(WebFrameTest, FullscreenRestoreScaleFactorUponExiting) { … }
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) { … }
#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameTest, DISABLED_PrintingBasic)
#else
TEST_F(WebFrameTest, PrintingBasic)
#endif
{ … }
class ThemeColorTestLocalFrameHost : public FakeLocalFrameHost { … };
TEST_F(WebFrameTest, ThemeColor) { … }
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) { … }
TEST_F(WebFrameSwapTest,
ValidateBrowserControlsSizeOnRemoteToLocalMainFrameSwap) { … }
namespace {
class SwapMainFrameWhenTitleChangesWebFrameClient
: public frame_test_helpers::TestWebFrameClient { … };
}
TEST_F(WebFrameTest, SwapMainFrameWhileLoading) { … }
TEST_F(WebFrameTest, SwapChildAddFrameInUnload) { … }
void WebFrameTest::SwapAndVerifyFirstChildConsistency(const char* const message,
WebFrame* parent,
WebFrame* new_child) { … }
TEST_F(WebFrameSwapTest, SwapFirstChild) { … }
TEST_F(WebFrameSwapTest, AdHighlightEarlyApply) { … }
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) { … }
TEST_F(WebFrameSwapTest, FramesOfRemoteParentAreIndexable) { … }
TEST_F(WebFrameSwapTest, FrameElementInFramesWithRemoteParent) { … }
class RemoteToLocalSwapWebFrameClient
: public frame_test_helpers::TestWebFrameClient { … };
TEST_F(WebFrameSwapTest, HistoryCommitTypeAfterExistingRemoteToLocalSwap) { … }
class RemoteFrameHostInterceptor : public FakeRemoteFrameHost { … };
TEST_F(WebFrameSwapTest, NavigateRemoteFrameViaLocation) { … }
TEST_F(WebFrameSwapTest, WindowOpenOnRemoteFrame) { … }
class TestRemoteMainFrameHostForWindowClose : public FakeRemoteMainFrameHost { … };
class RemoteWindowCloseTest : public WebFrameTest { … };
TEST_F(RemoteWindowCloseTest, WindowOpenRemoteClose) { … }
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) { … }
TEST_F(WebFrameTest, RemoteToLocalSwapOnMainFrameInitializesCoreFrame) { … }
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) { … }
TEST(WebFrameGlobalReuseTest, MainFrameWithNoOpener) { … }
TEST(WebFrameGlobalReuseTest, ChildFrame) { … }
TEST(WebFrameGlobalReuseTest, MainFrameWithOpener) { … }
TEST(WebFrameGlobalReuseTest, ReuseForMainFrameIfEnabled) { … }
class BlobRegistryForSaveImageFromDataURL : public mojom::blink::BlobRegistry { … };
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 { … };
TEST_F(WebFrameTest, DISABLED_ChangeResourcePriority) { … }
TEST_F(WebFrameTest, ScriptPriority) { … }
class MultipleDataChunkDelegate : public URLLoaderTestDelegate { … };
TEST_F(WebFrameTest, ImageDocumentDecodeError) { … }
TEST_F(WebFrameTest, RootLayerMinimumHeight) { … }
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
TEST_F(WebFrameSimTest, FocusOnBlurRemoveBubblingCrash) { … }
TEST_F(WebFrameSimTest, ScrollToEndBubblingCrash) { … }
TEST_F(WebFrameSimTest, TestScrollFocusedEditableElementIntoView) { … }
TEST_F(WebFrameSimTest, TestScrollFocusedEditableInRootScroller) { … }
TEST_F(WebFrameSimTest, ScrollFocusedIntoViewClipped) { … }
TEST_F(WebFrameSimTest, ScrollFocusedSelectionIntoView) { … }
TEST_F(WebFrameSimTest, DoubleTapZoomWhileScrolled) { … }
TEST_F(WebFrameSimTest, ChangeBackgroundColor) { … }
TEST_F(WebFrameSimTest, ScrollFocusedEditableIntoViewNoLayoutObject) { … }
TEST_F(WebFrameSimTest, ScrollEditContextIntoView) { … }
TEST_F(WebFrameSimTest, DisplayNoneIFrameHasNoLayoutObjects) { … }
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 { … };
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) { … }
}
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 { … };
TEST_F(WebFrameTest, FaviconURLUpdateEvent) { … }
class TestFocusedElementChangedLocalFrameHost : public FakeLocalFrameHost { … };
TEST_F(WebFrameTest, FocusElementCallsFocusedElementChanged) { … }
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) { … }
TEST_F(WebFrameSimTest, SetModifiedFeaturesInOverrideContext) { … }
TEST_F(WebFrameTest, IframeMoveBeforeConnectedSubframeCount) { … }
}