#include <memory>
#include <optional>
#include <tuple>
#include <utility>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/run_until.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
#include "components/input/cursor_manager.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "components/viz/common/features.h"
#include "components/viz/test/host_frame_sink_manager_test_api.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/renderer_host/input/touch_emulator_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_child_frame.h"
#include "content/browser/site_per_process_browsertest.h"
#include "content/common/input/synthetic_smooth_scroll_gesture.h"
#include "content/common/input/synthetic_tap_gesture.h"
#include "content/common/input/synthetic_touchpad_pinch_gesture.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "content/shell/common/shell_switches.h"
#include "content/test/mock_overscroll_observer.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom-test-utils.h"
#include "third_party/blink/public/mojom/widget/platform_widget.mojom-test-utils.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/display/display_switches.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/geometry/quad_f.h"
#if defined(USE_AURA)
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "content/public/browser/overscroll_configuration.h"
#include "content/test/mock_overscroll_controller_delegate_aura.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_rewriter.h"
#endif
#if BUILDFLAG(IS_MAC)
#include "ui/base/test/scoped_preferred_scroller_style_mac.h"
#endif
#if BUILDFLAG(IS_ANDROID)
#include "content/browser/renderer_host/render_widget_host_view_android.h"
#include "content/test/mock_overscroll_refresh_handler_android.h"
#endif
namespace content {
namespace {
constexpr float kHitTestTolerance = …;
constexpr float kHitTestLowTolerance = …;
class TestInputEventObserver : public RenderWidgetHost::InputEventObserver { … };
template <typename PointType>
void SetWebEventPositions(blink::WebPointerProperties* event,
const PointType& position_in_widget,
RenderWidgetHostViewBase* rwhv,
RenderWidgetHostViewBase* rwhv_root) { … }
template <typename PointType>
void SetWebEventPositions(blink::WebPointerProperties* event,
const PointType& position_in_widget,
RenderWidgetHostViewBase* rwhv_root) { … }
#if defined(USE_AURA)
void UpdateEventRootLocation(ui::LocatedEvent* event,
RenderWidgetHostViewBase* rwhv,
RenderWidgetHostViewBase* rwhv_root) { … }
void UpdateEventRootLocation(ui::LocatedEvent* event,
RenderWidgetHostViewBase* rwhv_root) { … }
#endif
void RouteMouseEventAndWaitUntilDispatch(
input::RenderWidgetHostInputEventRouter* router,
RenderWidgetHostViewBase* root_view,
RenderWidgetHostViewBase* expected_target,
blink::WebMouseEvent* event) { … }
void DispatchMouseEventAndWaitUntilDispatch(
WebContentsImpl* web_contents,
blink::WebMouseEvent& event,
RenderWidgetHostViewBase* location_view,
const gfx::PointF& location,
RenderWidgetHostViewBase* expected_target,
const gfx::PointF& expected_location) { … }
void DispatchMouseDownEventAndWaitUntilDispatch(
WebContentsImpl* web_contents,
RenderWidgetHostViewBase* location_view,
const gfx::PointF& location,
RenderWidgetHostViewBase* expected_target,
const gfx::PointF& expected_location) { … }
void SurfaceHitTestTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void OverlapSurfaceHitTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void NonFlatTransformedSurfaceHitTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void PerspectiveTransformedSurfaceHitTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void NestedSurfaceHitTestTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void HitTestLayerSquashing(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void HitTestWatermark(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
void HitTestNestedFramesHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
#if defined(USE_AURA)
void HitTestRootWindowTransform(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
#endif
#if defined(USE_AURA)
bool ConvertJSONToPoint(const std::string& str, gfx::PointF* point) { … }
bool ConvertJSONToRect(const std::string& str, gfx::Rect* rect) { … }
#endif
class SetMouseCaptureInterceptor
: public base::RefCountedThreadSafe<SetMouseCaptureInterceptor>,
public blink::mojom::WidgetInputHandlerHostInterceptorForTesting { … };
#if defined(USE_AURA)
class SystemEventRewriter : public ui::EventRewriter { … };
#endif
enum class HitTestType { … };
#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)
bool IsScreenTooSmallForPopup(const display::ScreenInfo& screen_info) { … }
#endif
}
class SitePerProcessHitTestBrowserTest : public SitePerProcessBrowserTestBase { … };
class SitePerProcessHighDPIHitTestBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
class SitePerProcessNonIntegerScaleFactorHitTestBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
class SitePerProcessUserActivationHitTestBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
#if defined(USE_AURA)
class SitePerProcessInternalsHitTestBrowserTest
: public testing::WithParamInterface<std::tuple<float>>,
public SitePerProcessHitTestBrowserTest { … };
constexpr float kMultiScale[] = …;
INSTANTIATE_TEST_SUITE_P(…);
#if defined(MEMORY_SANITIZER) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_ScrollNestedLocalNonFastScrollableDiv …
#else
#define MAYBE_ScrollNestedLocalNonFastScrollableDiv …
#endif
IN_PROC_BROWSER_TEST_P(SitePerProcessInternalsHitTestBrowserTest,
MAYBE_ScrollNestedLocalNonFastScrollableDiv) { … }
IN_PROC_BROWSER_TEST_P(SitePerProcessInternalsHitTestBrowserTest,
DISABLED_NestedLocalNonFastScrollableDivCoordsAreLocal) { … }
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CancelWheelScrollBubblingOnWheelTargetDeletion) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
#define MAYBE_TouchAndGestureEventPositionChange …
#else
#define MAYBE_TouchAndGestureEventPositionChange …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_TouchAndGestureEventPositionChange) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CSSTransformedIframeTouchEventCoordinates) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
BubbledScrollEventsTransformedCorrectly) { … }
namespace {
class OutgoingEventWaiter : public RenderWidgetHost::InputEventObserver { … };
class BadInputEventObserver : public RenderWidgetHost::InputEventObserver { … };
}
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
ScrollBubblingTargetWithUnrelatedGesture) { … }
class SitePerProcessEmulatedTouchBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
IN_PROC_BROWSER_TEST_F(SitePerProcessEmulatedTouchBrowserTest,
EmulatedTouchShowPressHasTouchID) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessEmulatedTouchBrowserTest,
EmulatedTouchScrollBubbles) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessEmulatedTouchBrowserTest,
EmulatedTouchPinchGoesToMainFrame) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessEmulatedTouchBrowserTest,
EmulatedGestureScrollBubbles) { … }
#if BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
TouchActionAckTimeout) {
GURL main_url(
embedded_test_server()->GetURL("/frame_tree/page_with_janky_frame.html"));
ASSERT_TRUE(NavigateToURL(shell(), main_url));
FrameTreeNode* root = web_contents()->GetPrimaryFrameTree().root();
ASSERT_EQ(1U, root->child_count());
GURL frame_url(embedded_test_server()->GetURL(
"baz.com", "/page_with_touch_start_janking_main_thread.html"));
auto* child_frame_host = root->child_at(0)->current_frame_host();
RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
RenderWidgetHostViewChildFrame* rwhv_child =
static_cast<RenderWidgetHostViewChildFrame*>(
child_frame_host->GetRenderWidgetHost()->GetView());
WaitForHitTestData(child_frame_host);
const gfx::Rect root_bounds = rwhv_root->GetViewBounds();
const gfx::Rect child_bounds = rwhv_child->GetViewBounds();
RenderFrameSubmissionObserver render_frame_submission_observer(
shell()->web_contents());
const float page_scale_factor =
render_frame_submission_observer.LastRenderFrameMetadata()
.page_scale_factor;
const gfx::PointF point_in_child(
(child_bounds.x() - root_bounds.x() + 25) * page_scale_factor,
(child_bounds.y() - root_bounds.y() + 25) * page_scale_factor);
SyntheticSmoothScrollGestureParams params;
params.gesture_source_type = content::mojom::GestureSourceType::kTouchInput;
params.anchor = gfx::PointF(point_in_child.x(), point_in_child.y());
params.distances.push_back(gfx::Vector2dF(0, -10));
params.speed_in_pixels_s = 100000;
std::unique_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
InputEventAckWaiter ack_observer(
child_frame_host->GetRenderWidgetHost(),
base::BindRepeating([](blink::mojom::InputEventResultSource source,
blink::mojom::InputEventResultState state,
const blink::WebInputEvent& event) {
return event.GetType() ==
blink::WebGestureEvent::Type::kGestureScrollEnd;
}));
ack_observer.Reset();
RenderWidgetHostImpl* render_widget_host =
root->current_frame_host()->GetRenderWidgetHost();
render_widget_host->QueueSyntheticGesture(
std::move(gesture), base::BindOnce([](SyntheticGesture::Result result) {
EXPECT_EQ(SyntheticGesture::GESTURE_FINISHED, result);
}));
ack_observer.Wait();
}
#endif
#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
RootConsumesScrollDuringOverscrollGesture) { … }
#endif
#if defined(USE_AURA)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, ScrollEventToOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
InputEventRouterWheelCoalesceTest) { … }
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, SurfaceHitTestTest) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_SurfaceHitTestTest …
#else
#define MAYBE_SurfaceHitTestTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
MAYBE_SurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
NestedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
NestedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
NonFlatTransformedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
NonFlatTransformedSurfaceHitTestTest) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_PerspectiveTransformedSurfaceHitTestTest …
#else
#define MAYBE_PerspectiveTransformedSurfaceHitTestTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_PerspectiveTransformedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
MAYBE_PerspectiveTransformedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
OverlapSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
OverlapSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
HitTestLayerSquashing) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
HitTestLayerSquashing) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, HitTestWatermark) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
HitTestWatermark) { … }
#if defined(USE_AURA)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, RootWindowTransform) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
RootWindowTransform) { … }
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
HitTestStaleDataDeletedView) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
SurfaceHitTestPointerEventsNoneChanged) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
PointerEventsNoneWithNestedSameOriginIFrame) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
PointerEventsNoneWithNestedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
HitTestNestedOccludedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
DISABLED_AsynchronousHitTestChildTimeout) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
AsynchronousHitTestChildDisconnectClient) { … }
#if !BUILDFLAG(IS_ANDROID)
class TooltipMonitor : public RenderWidgetHostViewBase::TooltipObserver { … };
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CrossProcessTooltipTest) { … }
#endif
#if BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CrossProcessTooltipTestAndroid) {
GURL main_url(embedded_test_server()->GetURL(
"a.com", "/cross_site_iframe_factory.html?a(b)"));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
->GetPrimaryFrameTree()
.root();
EXPECT_EQ(
" Site A ------------ proxies for B\n"
" +--Site B ------- proxies for A\n"
"Where A = http://a.com/\n"
" B = http://b.com/",
DepictFrameTree(root));
FrameTreeNode* b_node = root->child_at(0);
RenderWidgetHostViewBase* rwhv_a = static_cast<RenderWidgetHostViewBase*>(
root->current_frame_host()->GetRenderWidgetHost()->GetView());
RenderWidgetHostViewBase* rwhv_b = static_cast<RenderWidgetHostViewBase*>(
b_node->current_frame_host()->GetRenderWidgetHost()->GetView());
DCHECK(!rwhv_a->GetCursorManager());
WaitForHitTestData(b_node->current_frame_host());
gfx::Point point_in_a_frame(10, 10);
gfx::Point point_in_b_frame =
rwhv_b->TransformPointToRootCoordSpace(gfx::Point(25, 25));
RenderWidgetHostMouseEventMonitor a_frame_monitor(
root->current_frame_host()->GetRenderWidgetHost());
RenderWidgetHostMouseEventMonitor b_frame_monitor(
b_node->current_frame_host()->GetRenderWidgetHost());
std::string script_a =
"body = document.body.setAttribute('title', 'body_a_tooltip');\n"
"iframe = document.getElementsByTagName('iframe')[0];\n"
"iframe.setAttribute('title','iframe_for_b');";
EXPECT_TRUE(ExecJs(root->current_frame_host(), script_a));
std::string script_b =
"body = document.body.setAttribute('title', 'body_b_tooltip');";
EXPECT_TRUE(ExecJs(b_node->current_frame_host(), script_b));
blink::WebMouseEvent mouse_event(
blink::WebInputEvent::Type::kMouseMove,
blink::WebInputEvent::kNoModifiers,
blink::WebInputEvent::GetStaticTimeStampForTests());
auto* router = web_contents()->GetInputEventRouter();
gfx::Point current_point;
for (int iteration = 0; iteration < 2; ++iteration) {
current_point = point_in_a_frame;
current_point.Offset(iteration, iteration);
SetWebEventPositions(&mouse_event, current_point, rwhv_a);
RouteMouseEventAndWaitUntilDispatch(router, rwhv_a, rwhv_a, &mouse_event);
EXPECT_TRUE(a_frame_monitor.EventWasReceived());
a_frame_monitor.ResetEventReceived();
EXPECT_EQ(iteration != 0, b_frame_monitor.EventWasReceived());
b_frame_monitor.ResetEventReceived();
current_point = point_in_b_frame;
current_point.Offset(iteration, iteration);
SetWebEventPositions(&mouse_event, current_point, rwhv_a);
RouteMouseEventAndWaitUntilDispatch(router, rwhv_a, rwhv_b, &mouse_event);
EXPECT_TRUE(a_frame_monitor.EventWasReceived());
EXPECT_EQ(a_frame_monitor.event().GetType(),
blink::WebInputEvent::Type::kMouseMove);
a_frame_monitor.ResetEventReceived();
EXPECT_TRUE(b_frame_monitor.EventWasReceived());
b_frame_monitor.ResetEventReceived();
}
base::RunLoop run_loop;
base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(), TestTimeouts::action_max_timeout());
run_loop.Run();
}
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
#define MAYBE_CrossProcessMouseEnterAndLeaveTest …
#else
#define MAYBE_CrossProcessMouseEnterAndLeaveTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_CrossProcessMouseEnterAndLeaveTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CrossProcessMouseMoveAfterCaptureRelease) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
NoCrossProcessMouseMoveAfterCaptureRelease) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_ANDROID)
#define MAYBE_CrossProcessMouseCapture …
#else
#define MAYBE_CrossProcessMouseCapture …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_CrossProcessMouseCapture) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MouseCaptureOnDragSelection) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CacheCoordinateTransformUponMouseDown) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MouseCaptureOnFramesetResize) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CrossProcessMousePointerCapture) { … }
#if !BUILDFLAG(IS_ANDROID)
namespace {
class SetCursorInterceptor
: public blink::mojom::WidgetHostInterceptorForTesting { … };
void CursorUpdateReceivedFromCrossSiteIframeHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
}
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
CursorUpdateReceivedFromCrossSiteIframe) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
CursorUpdateReceivedFromCrossSiteIframe) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
LargeCursorRemovedInOffsetOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
LargeCursorRemovedInScrolledOOPIF) { … }
#endif
#if defined(USE_AURA)
class SitePerProcessMouseWheelHitTestBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
#if BUILDFLAG(IS_WIN)
#define MAYBE_MultipleSubframeWheelEventsOnMainThread …
#else
#define MAYBE_MultipleSubframeWheelEventsOnMainThread …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
MAYBE_MultipleSubframeWheelEventsOnMainThread) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_MainframeWheelEventsOnMainThread …
#else
#define MAYBE_MainframeWheelEventsOnMainThread …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
MAYBE_MainframeWheelEventsOnMainThread) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
InputEventRouterWheelTargetTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
DISABLED_MouseWheelEventPositionChange) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
SubframeTouchEventRouting) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MainframeTouchEventRouting) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
SubframeGestureEventRouting) { … }
namespace {
uint32_t SendTouchTapWithExpectedTarget(
RenderWidgetHostViewBase* root_view,
const gfx::Point& touch_point,
raw_ptr<input::RenderWidgetHostViewInput>& router_touch_target,
RenderWidgetHostViewBase* expected_target,
RenderWidgetHostImpl* child_render_widget_host) { … }
void SendGestureTapSequenceWithExpectedTarget(
RenderWidgetHostViewBase* root_view,
const gfx::Point& gesture_point,
base::WeakPtr<input::RenderWidgetHostViewInput>& router_gesture_target,
const RenderWidgetHostViewBase* expected_target,
const uint32_t unique_touch_event_id) { … }
void SendTouchpadPinchSequenceWithExpectedTarget(
RenderWidgetHostViewBase* root_view,
const gfx::Point& gesture_point,
raw_ptr<input::RenderWidgetHostViewInput>& router_touchpad_gesture_target,
RenderWidgetHostViewBase* expected_target) { … }
#if !BUILDFLAG(IS_WIN)
void SendTouchpadFlingSequenceWithExpectedTarget(
RenderWidgetHostViewBase* root_view,
const gfx::Point& gesture_point,
raw_ptr<input::RenderWidgetHostViewInput>& router_wheel_target,
RenderWidgetHostViewBase* expected_target) { … }
#endif
}
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
InputEventRouterGestureTargetMapTest) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest …
#else
#define MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest …
#endif
#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID)
IN_PROC_BROWSER_TEST_F(
SitePerProcessHitTestBrowserTest,
MAYBE_InputEventRouterGesturePreventDefaultTargetMapTest) { … }
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
InputEventRouterTouchpadGestureTargetTest) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
BUILDFLAG(IS_FUCHSIA)
#define MAYBE_TouchpadPinchOverOOPIF …
#else
#define MAYBE_TouchpadPinchOverOOPIF …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_TouchpadPinchOverOOPIF) { … }
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
TouchpadPinchWhenMissingHitTestDataDoesNotCrash) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
#define MAYBE_TouchpadDoubleTapZoomOverOOPIF …
#else
#define MAYBE_TouchpadDoubleTapZoomOverOOPIF …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_TouchpadDoubleTapZoomOverOOPIF) { … }
class ContextMenuObserverDelegate : public WebContentsDelegate { … };
void CreateContextMenuTestHelper(
Shell* shell,
net::test_server::EmbeddedTestServer* embedded_test_server) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_CreateContextMenuTest …
#else
#define MAYBE_CreateContextMenuTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
MAYBE_CreateContextMenuTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
MAYBE_CreateContextMenuTest) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#define MAYBE_PopupMenuTest …
#else
#define MAYBE_PopupMenuTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, MAYBE_PopupMenuTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
DISABLED_NestedPopupMenuTest) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
ScrolledNestedPopupMenuTest) { … }
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
DISABLED_ScrolledMainFrameSelectInLongIframe) { … }
#endif
#if defined(USE_AURA)
class SitePerProcessGestureHitTestBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
IN_PROC_BROWSER_TEST_F(SitePerProcessGestureHitTestBrowserTest,
SubframeGesturePinchGoesToMainFrame) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessGestureHitTestBrowserTest,
MainframeGesturePinchGoesToMainFrame) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessGestureHitTestBrowserTest,
SubframeGesturePinchDeniedBySubframeTouchAction) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessGestureHitTestBrowserTest,
SubframeGesturePinchNoCrash) { … }
#endif
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC)
#define MAYBE_MouseClickWithNonIntegerScaleFactor …
#else
#define MAYBE_MouseClickWithNonIntegerScaleFactor …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessNonIntegerScaleFactorHitTestBrowserTest,
MAYBE_MouseClickWithNonIntegerScaleFactor) { … }
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_NestedSurfaceHitTestTest …
#else
#define MAYBE_NestedSurfaceHitTestTest …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessNonIntegerScaleFactorHitTestBrowserTest,
MAYBE_NestedSurfaceHitTestTest) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, HitTestClippedFrame) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, HitTestNestedFrames) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
HitTestOOPIFWithPaddingAndBorder) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessUserActivationHitTestBrowserTest,
DISABLED_RenderWidgetUserActivationStateTest) { … }
class SitePerProcessHitTestDataGenerationBrowserTest
: public SitePerProcessHitTestBrowserTest { … };
const uint32_t
SitePerProcessHitTestDataGenerationBrowserTest::kFastHitTestFlags = …;
const uint32_t
SitePerProcessHitTestDataGenerationBrowserTest::kSlowHitTestFlags = …;
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
TransformedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
ClippedOOPIFFastPath) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
RotatedClippedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
ClippedRotatedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
ClipPathOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
OverlappedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
MaskedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
AncestorMaskedOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
PointerEventsNoneOOPIF) { … }
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestDataGenerationBrowserTest,
OccludedOOPIF) { … }
#if defined(USE_AURA)
SitePerProcessDelegatedInkBrowserTest;
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
#define MAYBE_MetadataAndPointGoThroughOOPIF …
#else
#define MAYBE_MetadataAndPointGoThroughOOPIF …
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessDelegatedInkBrowserTest,
MAYBE_MetadataAndPointGoThroughOOPIF) { … }
#endif
}