chromium/content/browser/site_per_process_hit_test_browsertest.cc

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

#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 {

// TODO(nzolghadr): We need to have a much lower tolerance across the board.
constexpr float kHitTestTolerance =;
constexpr float kHitTestLowTolerance =;

class TestInputEventObserver : public RenderWidgetHost::InputEventObserver {};

// |position_in_widget| is in the coord space of |rwhv|.
template <typename PointType>
void SetWebEventPositions(blink::WebPointerProperties* event,
                          const PointType& position_in_widget,
                          RenderWidgetHostViewBase* rwhv,
                          RenderWidgetHostViewBase* rwhv_root) {}

// For convenience when setting the position in the space of the root RWHV.
template <typename PointType>
void SetWebEventPositions(blink::WebPointerProperties* event,
                          const PointType& position_in_widget,
                          RenderWidgetHostViewBase* rwhv_root) {}

#if defined(USE_AURA)
// |event->location()| is in the coord space of |rwhv|.
void UpdateEventRootLocation(ui::LocatedEvent* event,
                             RenderWidgetHostViewBase* rwhv,
                             RenderWidgetHostViewBase* rwhv_root) {}

// For convenience when setting the position in the space of the root RWHV.
void UpdateEventRootLocation(ui::LocatedEvent* event,
                             RenderWidgetHostViewBase* rwhv_root) {}
#endif  // defined(USE_AURA)

void RouteMouseEventAndWaitUntilDispatch(
    input::RenderWidgetHostInputEventRouter* router,
    RenderWidgetHostViewBase* root_view,
    RenderWidgetHostViewBase* expected_target,
    blink::WebMouseEvent* event) {}

// Dispatch |event| to the specified view using browser process hit testing.
void DispatchMouseEventAndWaitUntilDispatch(
    WebContentsImpl* web_contents,
    blink::WebMouseEvent& event,
    RenderWidgetHostViewBase* location_view,
    const gfx::PointF& location,
    RenderWidgetHostViewBase* expected_target,
    const gfx::PointF& expected_location) {}

// Wrapper for the above method that creates a MouseDown to send.
void DispatchMouseDownEventAndWaitUntilDispatch(
    WebContentsImpl* web_contents,
    RenderWidgetHostViewBase* location_view,
    const gfx::PointF& location,
    RenderWidgetHostViewBase* expected_target,
    const gfx::PointF& expected_location) {}

// Helper function that performs a surface hittest.
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) {}

// Helper function that performs a surface hittest in nested frame.
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  // defined(USE_AURA)

#if defined(USE_AURA)
bool ConvertJSONToPoint(const std::string& str, gfx::PointF* point) {}

bool ConvertJSONToRect(const std::string& str, gfx::Rect* rect) {}
#endif  // defined(USE_AURA)

// Class for intercepting SetMouseCapture messages being sent to a
// RenderWidgetHost. Note that this only works for RenderWidgetHosts that
// are attached to RenderFrameHosts, and not those for page popups, which
// use different bindings.
class SetMouseCaptureInterceptor
    : public base::RefCountedThreadSafe<SetMouseCaptureInterceptor>,
      public blink::mojom::WidgetInputHandlerHostInterceptorForTesting {};

#if defined(USE_AURA)
// A class to allow intercepting and discarding of all system-level events
// that might otherwise cause unpredictable behaviour in tests.
class SystemEventRewriter : public ui::EventRewriter {};
#endif

enum class HitTestType {};

#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)
bool IsScreenTooSmallForPopup(const display::ScreenInfo& screen_info) {}
#endif

}  // namespace

class SitePerProcessHitTestBrowserTest : public SitePerProcessBrowserTestBase {};

//
// SitePerProcessHighDPIHitTestBrowserTest
//

class SitePerProcessHighDPIHitTestBrowserTest
    : public SitePerProcessHitTestBrowserTest {};

//
// SitePerProcessNonIntegerScaleFactorHitTestBrowserTest
//

class SitePerProcessNonIntegerScaleFactorHitTestBrowserTest
    : public SitePerProcessHitTestBrowserTest {};

//
// SitePerProcessUserActivationHitTestBrowserTest
//

class SitePerProcessUserActivationHitTestBrowserTest
    : public SitePerProcessHitTestBrowserTest {};

// Restrict to Aura to we can use routable MouseWheel event via
// RenderWidgetHostViewAura::OnScrollEvent().
#if defined(USE_AURA)
class SitePerProcessInternalsHitTestBrowserTest
    : public testing::WithParamInterface<std::tuple<float>>,
      public SitePerProcessHitTestBrowserTest {};

constexpr float kMultiScale[] =;
INSTANTIATE_TEST_SUITE_P();

// Flaky on MSAN. https://crbug.com/959924
// Flaky on Linux Wayland and Lacros. https://crbug.com/1158437
#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) {}

// TODO(crbug.com/41457695): disabled because tests are flaky
IN_PROC_BROWSER_TEST_P(SitePerProcessInternalsHitTestBrowserTest,
                       DISABLED_NestedLocalNonFastScrollableDivCoordsAreLocal) {}
#endif  // defined(USE_AURA)

// Tests that wheel scroll bubbling gets cancelled when the wheel target view
// gets destroyed in the middle of a wheel scroll seqeunce. This happens in
// cases like overscroll navigation from inside an oopif.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CancelWheelScrollBubblingOnWheelTargetDeletion) {}

// Ensure that the positions of touch events sent to cross-process subframes
// account for any change in the position of the subframe during the scroll
// sequence.
// Before the issue fix, we record the transform for root to subframe coordinate
// space and reuse it in the sequence. It is wrong if the subframe moved in the
// sequence. In this test, the point passed to subframe at the touch end (scroll
// end) would be wrong because the subframe moved in scroll.
// Suppose the offset of subframe in rootframe is (0, 0) in the test, the touch
// start position in root is (15, 15) same in subframe, then move to (15, 10)
// in rootframe and subframe it caused subframe scroll down for 5px, then touch
// release in (15, 10) same as the touch move in root frame. Before the fix the
// touch end would pass (15, 10) to subframe which should be (15, 15) in
// subframe.
// https://crbug.com/959848: Flaky on Linux MSAN bots
// https://crbug.com/959924: Flaky on Android MSAN bots
#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) {}

// When a scroll event is bubbled, ensure that the bubbled event's coordinates
// are correctly updated to the ancestor's coordinate space. In particular,
// ensure that the transformation considers CSS scaling of the child where
// simply applying the ancestor's offset does not produce the correct
// coordinates in the ancestor's coordinate space.
// See https://crbug.com/817392
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       BubbledScrollEventsTransformedCorrectly) {}

namespace {

// Waits until an event of the given type has been sent to the given
// RenderWidgetHost.
class OutgoingEventWaiter : public RenderWidgetHost::InputEventObserver {};

// Fails the test if an event of the given type is sent to the given
// RenderWidgetHost.
class BadInputEventObserver : public RenderWidgetHost::InputEventObserver {};

}  // namespace

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) {}

// Regression test for https://crbug.com/851644. The test passes as long as it
// doesn't crash.
// Touch action ack timeout is enabled on Android only.
#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);

  // Compute the point so that the gesture event can target the child frame.
  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));
  // The JS jank from the "page_with_touch_start_janking_main_thread.html"
  // causes the touch ack timeout. Set the speed high so that the gesture can be
  // completed quickly and so does this test.
  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  // BUILDFLAG(IS_ANDROID)

#if defined(USE_AURA) || BUILDFLAG(IS_ANDROID)

// When unconsumed scrolls in a child bubble to the root and start an
// overscroll gesture, the subsequent gesture scroll update events should be
// consumed by the root. The child should not be able to scroll during the
// overscroll gesture.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       RootConsumesScrollDuringOverscrollGesture) {}
#endif  // defined(USE_AURA) || BUILDFLAG(IS_ANDROID)

// Test that an EventType::kScroll event sent to an out-of-process iframe
// correctly results in a scroll. This is only handled by
// RenderWidgetHostViewAura and is needed for trackpad scrolling on Chromebooks.
#if defined(USE_AURA)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, ScrollEventToOOPIF) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       InputEventRouterWheelCoalesceTest) {}
#endif  // defined(USE_AURA)

// Test that mouse events are being routed to the correct RenderWidgetHostView
// based on coordinates.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, SurfaceHitTestTest) {}

// Same test as above, but runs in high-dpi mode.
#if BUILDFLAG(IS_ANDROID)
// High DPI browser tests are not needed on Android, and confuse some of the
// coordinate calculations. Android uses fixed device scale factor.
#define MAYBE_SurfaceHitTestTest
#else
#define MAYBE_SurfaceHitTestTest
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
                       MAYBE_SurfaceHitTestTest) {}

// Test that mouse events are being routed to the correct RenderWidgetHostView
// when there are nested out-of-process iframes.
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) {}

// TODO(kenrb): Running this test on Android bots has slight discrepancies in
// transformed event coordinates when we do manual calculation of expected
// values. We can't rely on browser side transformation because it is broken
// for perspective transforms. See https://crbug.com/854247.
#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  // defined(USE_AURA)

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       HitTestStaleDataDeletedView) {}

// This test tests that browser process hittesting ignores frames with
// pointer-events: none.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       SurfaceHitTestPointerEventsNoneChanged) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       PointerEventsNoneWithNestedSameOriginIFrame) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       PointerEventsNoneWithNestedOOPIF) {}

// This test tests that browser process can successfully hit test on nested
// OOPIFs that are partially occluded by main frame elements.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       HitTestNestedOccludedOOPIF) {}

// Verify that an event is properly retargeted to the main frame when an
// asynchronous hit test to the child frame times out.
// TODO(crbug.com/40806028) Flaky on all platforms
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       DISABLED_AsynchronousHitTestChildTimeout) {}

// Verify that asynchronous hit test immediately handle
// when target client disconnects.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       AsynchronousHitTestChildDisconnectClient) {}

// Tooltips aren't used on Android, so no need to compile/run this test in that
// case.
#if !BUILDFLAG(IS_ANDROID)
class TooltipMonitor : public RenderWidgetHostViewBase::TooltipObserver {};  // class TooltipMonitor

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CrossProcessTooltipTest) {}
#endif  // !BUILDFLAG(IS_ANDROID)

#if BUILDFLAG(IS_ANDROID)
// The following test ensures that we don't get a crash if a tooltip is
// triggered on Android. This test is nearly identical to
// SitePerProcessHitTestBrowserTest.CrossProcessTooltipTestAndroid, except
// it omits the tooltip monitor, and all dereferences of GetCursorManager().
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());

  // On Android we don't expect GetCursorManager() to return anything other
  // than nullptr. If it did, this test would be unnecessary.
  DCHECK(!rwhv_a->GetCursorManager());

  WaitForHitTestData(b_node->current_frame_host());

  // Make sure the point_in_a_frame value is outside the default 8px margin
  // for the body element.
  gfx::Point point_in_a_frame(10, 10);
  gfx::Point point_in_b_frame =
      rwhv_b->TransformPointToRootCoordSpace(gfx::Point(25, 25));

  // Create listeners for mouse events. These are used to verify that the
  // RenderWidgetHostInputEventRouter is generating MouseLeave, etc for
  // the right renderers.
  RenderWidgetHostMouseEventMonitor a_frame_monitor(
      root->current_frame_host()->GetRenderWidgetHost());
  RenderWidgetHostMouseEventMonitor b_frame_monitor(
      b_node->current_frame_host()->GetRenderWidgetHost());

  // Add tooltip text to both the body and the iframe in A.
  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));

  // Send mouse events to both A and B.
  blink::WebMouseEvent mouse_event(
      blink::WebInputEvent::Type::kMouseMove,
      blink::WebInputEvent::kNoModifiers,
      blink::WebInputEvent::GetStaticTimeStampForTests());
  auto* router = web_contents()->GetInputEventRouter();

  // Alternate mouse moves between main frame and the cross-process iframe to
  // test that the tool tip in the iframe can override the one set by the main
  // frame renderer, even on a second entry into the iframe.
  gfx::Point current_point;
  for (int iteration = 0; iteration < 2; ++iteration) {
    // The following is a bit of a hack to prevent hitting the same
    // position/node check in ChromeClient::SetToolTip().
    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();
    // B will receive a mouseLeave on all but the first iteration.
    EXPECT_EQ(iteration != 0, b_frame_monitor.EventWasReceived());
    b_frame_monitor.ResetEventReceived();

    // Next send a MouseMove to B frame, and A should receive a MouseMove event.
    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();
  }

  // This is an (arbitrary) delay to allow the test to crash if it's going to.
  base::RunLoop run_loop;
  base::SingleThreadTaskRunner::GetCurrentDefault()->PostDelayedTask(
      FROM_HERE, run_loop.QuitClosure(), TestTimeouts::action_max_timeout());
  run_loop.Run();
}
#endif  // BUILDFLAG(IS_ANDROID)

// This test verifies that MouseEnter and MouseLeave events fire correctly
// when the mouse cursor moves between processes.
// Flaky (timeout): https://crbug.com/1006635, crbug.com/334105909.
#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) {}

// Verify that when mouse capture is released after dragging to a cross-process
// frame, a special MouseMove is sent to the new frame to cause the cursor
// to update.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CrossProcessMouseMoveAfterCaptureRelease) {}

// Verify that a click gaining mouse capture and then releasing over the same
// frame does *not* generate an extra MouseMove as if it had moved to a
// different RenderWidgetHostView, even when there are nested cross-process
// frames and there is an obstruction over the parent frame.
// Regression test for https://crbug.com/1021508.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       NoCrossProcessMouseMoveAfterCaptureRelease) {}

// Verify that mouse capture works on a RenderWidgetHostView level.
// This test checks that a MouseDown triggers mouse capture when it hits
// a scrollbar thumb or a subframe, and does not trigger mouse
// capture if it hits an element in the main frame.
// Flaky, https://crbug.com/1269160
#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) {}

// Verify that upon MouseUp, the coordinate transform cached from the previous
// MouseDown event is applied.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CacheCoordinateTransformUponMouseDown) {}

// Verify that when a divider within a frameset is clicked, mouse capture is
// initiated.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       MouseCaptureOnFramesetResize) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CrossProcessMousePointerCapture) {}

// There are no cursors on Android.
#if !BUILDFLAG(IS_ANDROID)
namespace {

// Intercepts SetCursor calls. The caller has to guarantee that
// `render_widget_host` lives at least as long as SetCursorInterceptor.
class SetCursorInterceptor
    : public blink::mojom::WidgetHostInterceptorForTesting {};

// Verify that we receive a mouse cursor update message when we mouse over
// a text field contained in an out-of-process iframe.
void CursorUpdateReceivedFromCrossSiteIframeHelper(
    Shell* shell,
    net::test_server::EmbeddedTestServer* embedded_test_server) {}

}  // namespace

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       CursorUpdateReceivedFromCrossSiteIframe) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
                       CursorUpdateReceivedFromCrossSiteIframe) {}

// Regression test for https://crbug.com/1099276. An OOPIF at a negative offset
// from the main document should not allow large cursors to intersect browser
// UI.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       LargeCursorRemovedInOffsetOOPIF) {}

// Regression test for https://crbug.com/1454515. An OOPIF
// scrolled away from the main document should not allow
// large cursors to intersect browser UI.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       LargeCursorRemovedInScrolledOOPIF) {}
#endif  // !BUILDFLAG(IS_ANDROID)

#if defined(USE_AURA)
// Browser process hit testing is not implemented on Android, and these tests
// require Aura for RenderWidgetHostViewAura::OnTouchEvent().
// https://crbug.com/491334

// Ensure that scroll events can be cancelled with a wheel handler.
// https://crbug.com/698195

class SitePerProcessMouseWheelHitTestBrowserTest
    : public SitePerProcessHitTestBrowserTest {};

// Fails on Windows official build, see // https://crbug.com/800822
#if BUILDFLAG(IS_WIN)
#define MAYBE_MultipleSubframeWheelEventsOnMainThread
#else
#define MAYBE_MultipleSubframeWheelEventsOnMainThread
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
                       MAYBE_MultipleSubframeWheelEventsOnMainThread) {}

// Verifies that test in SubframeWheelEventsOnMainThread also makes sense for
// the same page loaded in the mainframe.
// Fails on Windows official build, see // https://crbug.com/800822
#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) {}

// Ensure that the positions of mouse wheel events sent to cross-process
// subframes account for any change in the position of the subframe during the
// scroll sequence.
// TODO(crbug.com/40663303): Flaky on all platforms.
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelHitTestBrowserTest,
                       DISABLED_MouseWheelEventPositionChange) {}

// Ensure that a cross-process subframe with a touch-handler can receive touch
// events.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       SubframeTouchEventRouting) {}

// This test verifies that the test in
// SitePerProcessHitTestBrowserTest.SubframeTouchEventRouting also works
// properly for the main frame. Prior to the CL in which this test is
// introduced, use of MainThreadFrameObserver in SubframeTouchEventRouting was
// not necessary since the touch events were handled on the main thread. Now
// they are handled on the compositor thread, hence the need to synchronize.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       MainframeTouchEventRouting) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       SubframeGestureEventRouting) {}

namespace {

// Defined here to be close to
// SitePerProcessHitTestBrowserTest.InputEventRouterGestureTargetQueueTest.
// Will wait for RenderWidgetHost's compositor thread to sync if one is given.
// Returns the unique_touch_id of the TouchStart.
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)
// Sending touchpad fling events is not supported on Windows.
void SendTouchpadFlingSequenceWithExpectedTarget(
    RenderWidgetHostViewBase* root_view,
    const gfx::Point& gesture_point,
    raw_ptr<input::RenderWidgetHostViewInput>& router_wheel_target,
    RenderWidgetHostViewBase* expected_target) {}
#endif  // !BUILDFLAG(IS_WIN)

}  // anonymous namespace

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       InputEventRouterGestureTargetMapTest) {}

// TODO: Flaking test crbug.com/802827
#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  // defined(USE_AURA) || BUILDFLAG(IS_ANDROID)

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       InputEventRouterTouchpadGestureTargetTest) {}

// Test that performing a touchpad pinch over an OOPIF offers the synthetic
// wheel events to the child and causes the page scale factor to change for
// the main frame (given that the child did not consume the wheel).
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN) || \
    BUILDFLAG(IS_FUCHSIA)
// TODO(crbug.com/41449850): Flaky on multiple platforms.
#define MAYBE_TouchpadPinchOverOOPIF
#else
#define MAYBE_TouchpadPinchOverOOPIF
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       MAYBE_TouchpadPinchOverOOPIF) {}

#endif  // defined(USE_AURA)

// Test that we can still perform a touchpad pinch gesture in the absence of viz
// hit test data without crashing.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       TouchpadPinchWhenMissingHitTestDataDoesNotCrash) {}

// Tests that performing a touchpad double-tap zoom over an OOPIF offers the
// synthetic wheel event to the child.
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
    BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FUCHSIA)
// TODO(crbug.com/41449850): Flaky on multiple platforms.
#define MAYBE_TouchpadDoubleTapZoomOverOOPIF
#else
#define MAYBE_TouchpadDoubleTapZoomOverOOPIF
#endif
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       MAYBE_TouchpadDoubleTapZoomOverOOPIF) {}

// A WebContentsDelegate to capture ContextMenu creation events.
class ContextMenuObserverDelegate : public WebContentsDelegate {};

// Helper function to run the CreateContextMenuTest in either normal
// or high DPI mode.
void CreateContextMenuTestHelper(
    Shell* shell,
    net::test_server::EmbeddedTestServer* embedded_test_server) {}

#if BUILDFLAG(IS_ANDROID)
// High DPI tests don't work properly on Android, which has fixed scale factor.
#define MAYBE_CreateContextMenuTest
#else
#define MAYBE_CreateContextMenuTest
#endif

// Test that a mouse right-click to an out-of-process iframe causes a context
// menu to be generated with the correct screen position.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       MAYBE_CreateContextMenuTest) {}

// Test that a mouse right-click to an out-of-process iframe causes a context
// menu to be generated with the correct screen position on a screen with
// non-default scale factor.
IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIHitTestBrowserTest,
                       MAYBE_CreateContextMenuTest) {}

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
// The Popup menu test often times out on linux. https://crbug.com/1111402
#define MAYBE_PopupMenuTest
#else
#define MAYBE_PopupMenuTest
#endif

// Test that clicking a select element in an out-of-process iframe creates
// a popup menu in the correct position.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, MAYBE_PopupMenuTest) {}

// Test that clicking a select element in a nested out-of-process iframe creates
// a popup menu in the correct position, even if the top-level page repositions
// its out-of-process iframe. This verifies that screen positioning information
// is propagating down the frame tree correctly.
// On Android the reported menu coordinates are relative to the OOPIF, and its
// screen position is computed later, so this test isn't relevant.
// Flaky on all other platforms: https://crbug.com/1074248
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       DISABLED_NestedPopupMenuTest) {}

// Verify that scrolling the main frame correctly updates the position to
// a nested child frame. See issue https://crbug.com/878703 for more
// information.
// On Mac and Android, the reported menu coordinates are relative to the
// OOPIF, and its screen position is computed later, so this test isn't
// relevant on those platforms.
// This has been disabled on CastOS due to flakiness per crbug.com/1074249.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       ScrolledNestedPopupMenuTest) {}
#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)

// On Mac and Android, the reported menu coordinates are relative to the OOPIF,
// and its screen position is computed later, so this test isn't relevant on
// those platforms. This has been disabled on CastOS due to flakiness per
// crbug.com/1074249. (This test is based on the one above which is disabled
// on CastOS for this reason).
//
// Tests that a <select>'s visibility is correctly computed and thus shows the
// popup when clicked.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)
// TODO(crbug.com/40252258): Test is flaky on every platform.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       DISABLED_ScrolledMainFrameSelectInLongIframe) {}
#endif  // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_CASTOS)

#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  // defined(USE_AURA)

// Android uses fixed scale factor, which makes this test unnecessary.
// MacOSX does not have fractional device scales.
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC)
#define MAYBE_MouseClickWithNonIntegerScaleFactor
#else
#define MAYBE_MouseClickWithNonIntegerScaleFactor
#endif
// Test that MouseDown and MouseUp to the same coordinates do not result in
// different coordinates after routing. See bug https://crbug.com/670253.
IN_PROC_BROWSER_TEST_F(SitePerProcessNonIntegerScaleFactorHitTestBrowserTest,
                       MAYBE_MouseClickWithNonIntegerScaleFactor) {}

// MacOSX does not have fractional device scales.
// Linux/Lacros started failing after Wayland window configuration fixes have
// landed. TODO(crbug.com/40832051): Re-enable once the test issue is addressed.
#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) {}

// Verify RenderWidgetHostInputEventRouter can successfully hit test
// a MouseEvent and route it to a clipped OOPIF.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, HitTestClippedFrame) {}

// Verify InputTargetClient works within an OOPIF process.
IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest, HitTestNestedFrames) {}

IN_PROC_BROWSER_TEST_F(SitePerProcessHitTestBrowserTest,
                       HitTestOOPIFWithPaddingAndBorder) {}

// TODO(crbug.com/40804367): This flakes badly on debug & sanitizer
// builds on almost all platforms, and on Mac and Android.
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;

// Test confirms that a point hitting an OOPIF that is requesting delegated ink
// trails results in the metadata being correctly sent to the child's
// RenderWidgetHost and is usable for sending delegated ink points.
// TODO(crbug.com/40835227): Fix and enable the test on Fuchsia.
// TODO(crbug.com/40935254): flaky on ChromeOS
// TODO(http://b/331190208): Test failing on Linux
#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  // USE_AURA

}  // namespace content