#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/test/property_tree_test_utils.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/synthetic_web_input_event_builders.h"
#include "third_party/blink/renderer/core/css/properties/css_property_ref.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/events/add_event_listener_options_resolved.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/html_div_element.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.h"
#include "third_party/blink/renderer/platform/widget/widget_base.h"
#include "ui/base/ui_base_types.h"
namespace blink {
_;
bool operator==(const InputHandlerProxy::DidOverscrollParams& lhs,
const InputHandlerProxy::DidOverscrollParams& rhs) { … }
namespace {
class TouchMoveEventListener final : public NativeEventListener { … };
}
class WebFrameWidgetSimTest : public SimTest { … };
TEST_F(WebFrameWidgetSimTest, AutoResizeAllocatedLocalSurfaceId) { … }
TEST_F(WebFrameWidgetSimTest, FrameSinkIdHitTestAPI) { … }
#if BUILDFLAG(IS_ANDROID)
TEST_F(WebFrameWidgetSimTest, ForceSendMetadataOnInput) {
const cc::LayerTreeHost* layer_tree_host =
WebView().MainFrameViewWidget()->LayerTreeHostForTesting();
EXPECT_FALSE(
layer_tree_host->pending_commit_state()->force_send_metadata_request);
WebView().MainFrameViewWidget()->ShowVirtualKeyboard();
EXPECT_TRUE(
layer_tree_host->pending_commit_state()->force_send_metadata_request);
}
#endif
class WebFrameWidgetImplRemoteFrameSimTest : public SimTest { … };
TEST_F(WebFrameWidgetImplRemoteFrameSimTest,
ActivePinchGestureUpdatesLayerTreeHostSubFrame) { … }
const char EVENT_LISTENER_RESULT_HISTOGRAM[] = …;
enum { … };
class MockHandledEventCallback { … };
class MockWebFrameWidgetImpl : public frame_test_helpers::TestWebFrameWidget { … };
class WebFrameWidgetImplSimTest : public SimTest { … };
TEST_F(WebFrameWidgetImplSimTest, CursorChange) { … }
TEST_F(WebFrameWidgetImplSimTest, RenderWidgetInputEventUmaMetrics) { … }
TEST_F(WebFrameWidgetImplSimTest, SendElasticOverscrollForTouchpad) { … }
TEST_F(WebFrameWidgetImplSimTest, SendElasticOverscrollForTouchscreen) { … }
TEST_F(WebFrameWidgetImplSimTest, TestStartStylusWritingForInputElement) { … }
TEST_F(WebFrameWidgetImplSimTest,
TestStartStylusWritingForContentEditableElement) { … }
TEST_F(WebFrameWidgetImplSimTest,
TestStartStylusWritingForContentEditableChildElement) { … }
class NotifySwapTimesWebFrameWidgetTest : public SimTest { … };
TEST_F(NotifySwapTimesWebFrameWidgetTest, NotifyOnSuccessfulPresentation) { … }
TEST_F(NotifySwapTimesWebFrameWidgetTest,
ReportPresentationOnlyOnSuccessfulCommit) { … }
TEST_F(WebFrameWidgetSimTest, ActivePinchGestureUpdatesLayerTreeHost) { … }
class WebFrameWidgetInputEventsSimTest
: public WebFrameWidgetSimTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(WebFrameWidgetInputEventsSimTest, DispatchBufferedTouchEvents) { … }
TEST_F(WebFrameWidgetSimTest, PropagateScaleToRemoteFrames) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreEmptyBeforeFocus) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterFocusChange) { … }
TEST_F(WebFrameWidgetSimTest, DisplayStateMatchesWindowShowState) { … }
TEST_F(WebFrameWidgetSimTest, ResizableMatchesCanResize) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterLayoutChange) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterPageScroll) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterElementScroll) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterCommit) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreCorrectAfterDelete) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsInFrame) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsWithDifferentZoom) { … }
TEST_F(WebFrameWidgetSimTest, TestLineBoundsAreClippedInSubframe) { … }
class EventHandlingWebFrameWidgetSimTest : public SimTest { … };
TEST_F(EventHandlingWebFrameWidgetSimTest, NonRafAlignedEventWithoutUpdate) { … }
TEST_F(EventHandlingWebFrameWidgetSimTest,
NonRafAlignedEventWithoutUpdateAfterUpdate) { … }
TEST_F(EventHandlingWebFrameWidgetSimTest, NonRafAlignedEventWithUpdate) { … }
TEST_F(EventHandlingWebFrameWidgetSimTest, RafAlignedEventWithoutUpdate) { … }
TEST_F(EventHandlingWebFrameWidgetSimTest, RafAlignedEventWithUpdate) { … }
}